0

How translate HTML string (not table!) format for example:

"<p><strong>Spend</strong></p><ul><li>Media spend: 963 889 SEK</li<li>Avarage vCPM: 47,58 SEK</li><li>SPA (step 1): 45,55 SEK</li><li>Budget CTC: 1 085 594 SEK</li></ul>"

to pptx Slide with same styles as HTML using PptxGenJS?

2
  • "It is possible..." - have you tried to do it yourself first?
    – Dai
    Commented Jan 4, 2021 at 18:14
  • The documentation says that you can use <table> tags. Google has no answer to the question of converting from html to pptx using pptxgenjs. Maybe someone came across this in practice. I would not like to use crutches
    – Mark Oprya
    Commented Jan 4, 2021 at 18:23

1 Answer 1

2

I found solution - https://github.com/it-beyondit/html2pptxgenjs. Now i'll try to use it in my project


Updated: yes, this is perfect solution!

import {htmlToPptxText} from 'html2pptxgenjs';

const items = htmlToPptxText(data.value);

slide.addText(items, {
    x: data.x * blockWidth,
    y: 0,
    w: 1 * blockWidth,
    h: 1 * blockHeight,
    valign: 'middle',
    color: '000000',
    margin: 1,
});

Not the answer you're looking for? Browse other questions tagged or ask your own question.