13.09.2016 Views

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Solution Overview<br />

801<br />

Listing 32.6<br />

Continued<br />

pdf_fill_stroke($pdf);<br />

} else {<br />

pdf_stroke($pdf);<br />

}<br />

}<br />

?><br />

The certificate produced using this script is shown in Figure 32.7. As you can see, it is<br />

quite similar to the others, except that the border is simpler <strong>and</strong> the star looks a little different.The<br />

reason is that they are drawn into the document rather than taken from an<br />

existing clip art file.<br />

Figure 32.7<br />

The pdflib.php script draws the certificate into<br />

a PDF document.<br />

Now let’s look at some of the parts of this script that are different from the previous<br />

examples.<br />

Visitors need to get their own details on a certificate, so you create the document in<br />

memory rather than in a file. If you wrote it to a file, you would need to worry about<br />

mechanisms to create unique filenames, stop people from snooping into others’ certificates,<br />

<strong>and</strong> determine a way to delete older certificate files to free hard drive space on the server.

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

Saved successfully!

Ooh no, something went wrong!