Specifications

There is a free trial option for this service if you want to test it out.
There is also a free ftp-based interface to ps2pdf at the Net Distillery:
http://www.babinszki.com/distiller/
Software to Create PDF Programmatically
Support for creating PDF documents is available from within PHP. Two different function
libraries are available, with similar intentions. As they rely on external libraries, neither is
compiled in to PHP by default.
PHPs PDFlib functions use the PDFlib library, available from
http://www.pdflib.com
The ClibPDF functions use the ClibPDF library, available from
http://www.fastio.com/
Both these libraries are similar. They provide an API of functions to generate a PDF document.
We have elected to use PDFlib because it seems to be updated and maintained more regularly.
It is worth noting that neither of these libraries are Free Software. Both permit some non-
commercial use without charge, but require a license fee if you intend to provide a commercial
service using them.
You can see if PDFlib is already installed on your system by checking the output of the func-
tion phpinfo(). Under the heading pdf, you can find out if PDFlib support is enabled, as well
as the version of PDFlib used.
In order to install PDFlib, you will also need to install the TIFF library, available from
http://www.libtiff.org/
and the JPEG library, available from
ftp://ftp.uu.net/graphics/jpeg/
On a UNIX system, these pieces of software are installed in the usual way, using configure
and make. You will need to recompile PHP with the switch --with-pdflib.
On a Windows server, the easiest way to get PDFlib support is to download one of the unoffi-
cial precompiled binaries available on the Web. To test the code from this chapter on a
Windows machine, we got a precompiled binary from
http://php.weblogs.com/easywindows
Another popular build is available from
http://www.php4win.de
Generating Personalized Documents in Portable Document Format (PDF)
C
HAPTER 30
30
GENERATING
PERSONALIZED
DOCUMENTS IN
PDF
751
36 7842 CH30 3/6/01 3:40 PM Page 751