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.

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

n<br />

n<br />

n<br />

n<br />

n<br />

n<br />

n<br />

n<br />

Result in a high-quality printout<br />

Require only a small file to be downloaded<br />

Be generated almost instantly<br />

Be at a low cost to produce<br />

Work on many operating systems<br />

Be difficult to fraudulently duplicate or modify<br />

Not require any special software to view or print<br />

Display <strong>and</strong> print consistently for all recipients<br />

Like many decisions you need to make from time to time, you will probably need to<br />

compromise when choosing a delivery format to meet as many of these attributes as<br />

possible.<br />

Evaluating Document Formats<br />

The most important decision you need to make is what format to deliver the certificate<br />

in. Options include paper, ASCII text, HTML, Microsoft Word or another word processor’s<br />

format, Rich Text Format, PostScript, <strong>and</strong> Portable Document Format. Given the<br />

attributes listed previously, you can consider <strong>and</strong> compare some of the options.<br />

Paper<br />

Delivering the certificate on paper has some obvious advantages.You retain complete<br />

control over the process.You can see exactly what each certificate output looks like<br />

before sending it to the recipient. Plus, you don’t need to worry about software or b<strong>and</strong>width,<br />

<strong>and</strong> the certificate can be printed with anticounterfeiting measures.<br />

Paper would meet all of your needs except for being able to generate instantly <strong>and</strong><br />

being low cost to produce:The certificate could not be created <strong>and</strong> delivered quickly.<br />

Postal delivery could take days or weeks depending on your <strong>and</strong> the recipient’s location.<br />

Each certificate would also cost a few cents to a few dollars in printing <strong>and</strong> postage<br />

costs <strong>and</strong> probably more in h<strong>and</strong>ling. Automatic electronic delivery would be cheaper.<br />

ASCII<br />

Delivering documents as ASCII or plain text comes with some advantages. Compatibility<br />

is no problem. B<strong>and</strong>width required would be small, so cost would be very low.The simplicity<br />

of the result makes it easy to design <strong>and</strong> quick for a script to generate.<br />

If you present your visitors with an ASCII file, however, you have very little control<br />

over the appearance of their certificates.You cannot control fonts or page breaks.You can<br />

only include text <strong>and</strong> have very little control over formatting.You have no control over a<br />

recipient’s duplication or modification of the document.This is the method that makes it<br />

easiest for the recipient to fraudulently alter her certificate.

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

Saved successfully!

Ooh no, something went wrong!