Do you know any way to generate doc
and docx
files with PHP and without COM component? I've tried PHPWord
, which creates docx files, but these cannot be opened in OpenOffice
because they cause it to crash. I've also tried PHPDocx
, but it didn't generate any files at all.
Generating word documents with JS:
I have created a simple open-source library that will replace tags by values.
For example Hi {name}
with data={name:"John"}
will be replaced by Hi John
.
Here it is : https://github.com/edi9999/docxtemplater