# Generate PDF, DOCX and DOC with PHP

**URL:** <https://forum.kirupa.com/t/generate-pdf-docx-and-doc-with-php/281134>\
**Category:** programming\
**Created:** [February 5, 2009, 9:06am UTC](https://forum.kirupa.com/t/generate-pdf-docx-and-doc-with-php/281134 "2009-02-05T09:06:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leo\_bonnafe](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@leo\_bonnafe](https://forum.kirupa.com/u/leo_bonnafe)\
**Post date:** [February 5, 2009, 9:06am UTC](https://forum.kirupa.com/t/generate-pdf-docx-and-doc-with-php/281134/1 "2009-02-05T09:06:30Z")

</div>

First of all, hello to all – I am new here 🙂

I have just come across a new project that allows you to generate PDF, DOCX and DOC files with PHP.

All you have to do, is create a template in Open Office (or Word). In the template, you create the layout of the document and insert a number of text fields. These text fields are then populated with data from PHP and the document can be saved as a PDF file or in any other supported format. The concept is good old “mail-merge”.

[http://www.phplivedocx.org/articles/brief-introduction-to-phplivedocx/](http://www.phplivedocx.org/articles/brief-introduction-to-phplivedocx/)

From the web sites’ blurb: “phpLiveDocx allows developers to generate documents by combining structured data from PHP with a template, created in a word processor. The resulting document can be saved as a PDF, DOCX, DOC or RTF file.”

I am currently adding phpLiveDocx to an online store I am working on. The customer wants his store to create an invoice and sent it by e-mail as a PDF attachment. The invoice should use the same template file that is used in the internal accounting software (which is a DOC file).

phpLiveDocx works well and it is much easier to get good results than with FPDF, TCPDF or Zend\_Pdf.

Download here:

[http://www.phplivedocx.org/downloads/](http://www.phplivedocx.org/downloads/)

Have fun 🙂

Leo
