如何使用模板处理器在phpword中添加图片?

问题描述 投票:0回答:1

好吧,我终于让 phpword 模板处理器工作了,现在我遇到了一个小问题:我想动态地将图片添加到我的模板中。到目前为止,我一直在替换模板中的内容,如下所示:

$templateProcessor->setValue('name', 'MY NAME COMES HERE');

$templateProcessor->setValue('name2', 'OWW YEA PHPWORD IS WONDERFUL');

如何更换图像?任何帮助将非常感激!

php docx phpword
1个回答
0
投票

与此同时,较新的版本提供了多种选项,包括确定高度和宽度以及比例:

https://phpword.readthedocs.io/en/develop/templates-processing.html#setimagevalue

© www.soinside.com 2019 - 2024. All rights reserved.