Hello all

Zend_Pdf is a great component to generate PDF files with ZF. If you
want to populate PDF templates with text, however, it can be very time
consuming to get the positioning of the text fields just right. I
wrote about this issue here:

http://tinyurl.com/bym43f

After having developed several ZF applications in which text had to be
inserted into PDF templates, I knew there must be a better way and
went about developing one.

The result is a project called phpLiveDocx, which is an unofficial
component for ZF. (If it were to become official component some day, I
would be thrilled.)

The idea is really simple:

1. You design a template in a word processing package (such as Open
Office or Word). In the template, you define any number of text
fields, into which data will be later inserted (same idea as
mail-merge).

2. Using phpLiveDocx, you assign data to the template.

3. You generate and save the populated document as a PDF, DOCX, DOC or RTF file.

The great advantage of this approach is that you uncouple the
formatting of the template and the position of the text fields. In
other words, should a designer change the layout of a template, there
is no need for a developer to update the positioning of the text
fields.

Of course, the other great advantage is that you can save the
resulting document as DOCX, DOC or RTF, in addition to PDF.

Here is a really basic example, which illustrates how phpLiveDocx works:

http://tinyurl.com/ao9c2v

(The template and resulting document can be download from the bottom
of the post.)

Here is a very short getting started guide and download links:

http://tinyurl.com/db23fc

If you need any help or want to talk about phpLiveDocx, just follow up
here or post me a message:

http://tinyurl.com/culdpj

Thank you

Jonathan Maron
http://www.phpLiveDocx.org

Reply via email to