Specifications
FIGURE 30.6
pdf.php generates a certificate from an PDF template.
One problem with this approach is that the code runs quite slowly because of the regular
expression matching required. Regular expressions run much more slowly than str_replace()
that we could use for the RTF version.
If you are going to match a large number of placeholders or try to generate many of these doc-
uments on the same server, you might want look at other approaches. This would be less of a
problem for a simpler template. Much of the bulk in this file is data representing the images.
Generating a PDF Document Using PDFlib
PDFlib is intended for generating dynamic PDF documents via the Web. It is not strictly part
of PHP, but rather a separate library, with a large number of functions intended to be called
from a wide variety of programming languages. Language bindings are available for C, C++,
Java, Perl, Python, Tcl, and ActiveX/COM.
Interestingly, there is not an official PDFlib PHP binding available yet. The current binding is
not documented or supported by PDFlib. The PDFlib Web site states, “Other language bind-
ings, such as PHP, will be supported in the future,” but it has said this for at least a year.
Generating Personalized Documents in Portable Document Format (PDF)
C
HAPTER 30
30
GENERATING
PERSONALIZED
DOCUMENTS IN
PDF
765
36 7842 CH30 3/6/01 3:40 PM Page 765