【发布时间】:2023-10-26 13:02:02
【问题描述】:
phpword 错误导出 base64 图像到 docx 文件。
我有带有 base64 图像的 html。 我想将此 html 导出到 docx 文件。 我用phpword。
$html = $obText->getHtml();
$pw = new \PhpOffice\PhpWord\PhpWord();
$section = $pw->addSection();
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html, false, false);
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($pw, 'Word2007');
$objWriter->save($finalFilePath);
除此之外 - 我有包含文本、表格但没有图像的 docx 文件。 为什么?怎么了?
【问题讨论】: