I am trying to create a Microsoft word document without using any 3rd party libraries. What I am trying to do is :
- Create a template document in Microsoft Word
- Save it as an XML File
- Read this XML file and populate the data in PHP
I am able to do it so far. I would like to export it as an *.docx format. However when I do that, it is throwing an exception, when I try to open it.
Error Message : File is corrupt and cannot be opened
However, when I save it as *.doc, I am able to open the word document.
Any idea, what could be wrong. Do I need to use any libraries to export it to an docx file ?
Thanks