问题描述
我需要修改一个现成的DOCX表单文件(一个只能在灰色背景下输入数据的文件),并填写该表单并尽可能输入特定的文本。事实是它出现在以下代码中:
<w:instrText>FORMTEXT</w:instrText>
(并且在同一标签和文本FORMTEXT中出现5次)
代码不起作用,实际上没有任何改变。
\PhpOffice\PhpWord\Settings::setZipClass(\PhpOffice\PhpWord\Settings::PCLZIP);
\PhpOffice\PhpWord\Settings::setOutputEscapingEnabled(true);
$phpword = new \PhpOffice\PhpWord\TemplateProcessor('filebefore.docx');
$phpword->setValue("FORMTEXT","test",$phpword);
$phpword->setValue("FORMTEXT","test2","test3","test4","test5",$phpword);
$finalname = "fileafter";
$phpword->saveAs($finalname . '.docx');
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)