php docx template modification

Blu Towers picture Blu Towers · Oct 24, 2011 · Viewed 19.1k times · Source

Has anybody had any experience editing a docx template. My php admin area needs the functionality to modify docx templates, this functionality will be used a lot so memory is important.

I have found phpword which is in beta, it works but not 100%

I have been googling and found phpdocx, has anybody used this and can give me some feedback?

Are there any other solutions all i need is the ability to change text and maybe an image within a docx template.

I will be prepared to pay for a service but not masses and a one off fee for license would be preferred.

Answer

Skrol29 picture Skrol29 · Oct 25, 2011

You should try OpenTBS.

It's an open source PHP library which builds DOCX with the technique of templates.

No temp directory, no extra exe needed. First create your DOCX, XLSX, PPTX with Ms Office, (ODT, ODS, ODP are also supported, that's OpenOffice files). Then you use OpenTBS to load the template and change the content using the Template Engine (easy, see the demo). At the end, you save the result where you need. It can be a new file, a download flow, a PHP binary string.

OpenTBS can also change pictures and charts in a document.