tags:

views:

124

answers:

4

Hi friends, I have to modify the uploaded .doc or .docx file in php. I googled but i only found how to read that. I want the word file as it is and put text at the bottom of that MS Word file at run time. How is this possible anyone know please reply or give me example script.

Thanks,

+2  A: 

You can use PHPWord.

Shubham
Thanks, for reply.
A: 

Hi, I have already use the PHPWORD but it only creates .docx file not modify. I want to edit the existing word files. And if files in .doc then it will as it in .doc extension and if file is .docx then it will be in same format. Please reply,

Thanks,

A: 

Try having a look at http://www.tinybutstrong.com/ as it can create and edit Word documents, we use it in a mail merge style for generating invoices in doc and pdf.

DavidYell
thnks to reply. But i couldn't find my requirement in http://www.tinybutstrong.com/ . Can you please give me example to that. Thanks,
A: 

I'm the developer of PHPWord. You can use the PHPWord_Template Class to open an existing DOCX File and then replace some text marks with your individual text.

Alternatively you can open the DOCX file with the ZipArchive extension and then read/write every xml File (document.xml, header.xml, footer.xml, ...) you want. This method is nothing else than the PHPWord_Template class. ;)

Matthias Backhaus