Discussion:
PDF and PHP Use Case
Aaron Wormus
2007-08-25 11:04:19 UTC
Permalink
We use PHP and PDFs to create various reports at HedgeCo. The
requirements that we had for choosing our software was:

* Fast
* Easy to change design
* Flexible / Extensible engine
* Ability to handle dynamic content, images and page breaks
intelligently

After evaluating most of the commercial and open source platforms, we
ended up using html2pdf from tufat.com. I understand that this is may be
one level of abstraction higher than what you are planning on doing with
Zend_PDF, but since we generate a lot of PDFs I figured I would share
the experience.

html2pdf is a well written modular HTML parser which can output PDFs
using all of the most popular PHP pdf generation tools (FPDF, PDFLib).
Over 500 xhtml tags are supported, and the interface for adding new tags
or custom functionality is very straightforward.

Some problems with this system are:

* Slow (very slow)
* Unable to include external PDFs (we need this for vector graphs)
* Sizes of generated PDFs are often unnecessarily large

The benefits are the way it fits into our design process. We use smarty
plugins very heavily, and the benefit of being able to do all of the
design work in xhtml and then outputting the elements using the same
smarty plugins that we use in the websites is huge. Now that the
framework is in place, the process of creating attractive designs and
quickly changing the designs adding new functionality can be done by one
of our graphic designers, and doesn't require massive changes to the
code that generates the reports.

Html2pdf has everything I need. We are working on the speed aspects, and
I am sure that including external PDFs is probably fairly simple as well
(we just haven't had the resources to tackle that yet).


Our next project which we are still specing out, will focus on the
personalization of PDF files. Basically the client will upload a set of
pre-existing PDF documents as well as some pre-defined rules, and the
system will modify the PDF files and serve them out using both web and
email.

If you have any questions please CC me as I am not on the mailing list.

Aaron Wormus
Managing Director, HedgeCo Websites

HedgeCo Networks
400 Clematis St. Suite 205
33401 FL

Phone: 561 835 8690
Web: http://www.hedgeconetworks.com

Loading...