13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

788 Chapter 32 Generating Personalized Documents in Portable Document Format (PDF)<br />

Figure 32.5<br />

The rtf.php script generates a certificate from an RTF template.<br />

Generating a PDF Certificate from a Template<br />

The process of generating a PDF certificate from a template is similar.The main difference<br />

is that when you create the PDF file, some of the placeholders might be interspersed<br />

with formatting codes, depending on the version of Acrobat you are using. For example, if<br />

you look in the certificate template file you have created (using a text editor), you can see<br />

that the placeholders now look like this:<br />

<br />

<br />

<br />

<br />

If you look through the file, you will see that, unlike RTF, this is not a format that<br />

humans can easily read through.<br />

Note<br />

The format of the PDF template file may vary depending on the version of Acrobat or other PDF generation<br />

tool you are using. The code supplied in this example may not work as written when you generate your own<br />

templates. Check your template <strong>and</strong> alter the code to suit. If you still have problems, use the PDFlib example<br />

given later in the chapter.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!