【问题标题】:Converting HTML text string to pptx slide using PptxGenJS使用 PptxGenJS 将 HTML 文本字符串转换为 pptx 幻灯片
【发布时间】:2021-01-04 18:12:59
【问题描述】:

例如如何翻译 HTML 字符串(不是表格!)格式:

"<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>"

使用 PptxGenJS 转换为与 HTML 相同样式的 pptx 幻灯片?

【问题讨论】:

  • “有可能……” - 你试过自己先做吗?
  • 文档说你可以使用 标签。对于使用 pptxgenjs 从 html 转换为 pptx 的问题,Google 没有答案。也许有人在实践中遇到过这种情况。我不想使用拐杖

标签: html text pptxgenjs


【解决方案1】:

我找到了解决方案 - https://github.com/it-beyondit/html2pptxgenjs。现在我将尝试在我的项目中使用它


更新:是的,这是完美的解决方案!

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,
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-09-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多