PhpWord doesn't replace text

前端 未结 7 1675
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-14 09:10

I have a docx file and I need to replace some text. This is done inside codeigniter framework; here is the code:

$this->load->library(\'word\');       
$te         


        
7条回答
  •  半阙折子戏
    2021-02-14 10:00

    here i try and working well,

    setValue function does not work because it include the format of word after generate to web. so the text you might replace not found.

    the solution is just type your ${replaceKey} to notepad and copy it to your_template.docx it working for me.

    notepad make all word format not included to the template so the function setValue can found it as expected.

    Hope it Helping you guys.

提交回复
热议问题