开发者

word document {tokens} replacement using PHP

开发者 https://www.devze.com 2023-04-11 23:18 出处:网络
I am trying to read a .doc file and find tokens like {name}, {phone}, {address} etc. now display tokens with text box and allow user to replace by inserting original data. so that .doc file will repla

I am trying to read a .doc file and find tokens like {name}, {phone}, {address} etc. now display tokens with text box and allow user to replace by inserting original data. so that .doc file will replace with actual data.how to do this using php? the color, fonts, and style of .doc should not be changed. thanks.开发者_StackOverflow中文版...


This will be very tricky if you are using the old style Word documents. The new Word documents are saved in a some sort of Zip archive and therefore are much easier to edit.

You can extract this files and with some knowledge of the contents and Word WSDL you can edit the contents of the file.

Much easier is to make use of the PHPDocX Library. We are using it in a project and works like a charm. Only disadvantage is that it only works with .docx files.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号