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.

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

Rich Text Format<br />

Rich Text Format (RTF) gives you most of the power of Word, but the files are easier to<br />

generate.You still have flexibility over layout <strong>and</strong> formatting of the printed page.You can<br />

still include elements such as vector or bitmap images. Plus, you can still be fairly sure that<br />

the users will see a similar result to yours when they view or print the document.<br />

RTF is Microsoft Word’s text format. It is intended as an interchange format to transfer<br />

documents between different programs. In some ways, it is similar to HTML. It uses<br />

syntax <strong>and</strong> key words rather than binary data to convey formatting information. It is<br />

therefore relatively human readable.<br />

The format is well documented.The specification is freely available; search the<br />

Microsoft.com web site for “RTF specification”.<br />

The easiest way to generate an RTF document is to choose a Save As RTF option in<br />

your word processor. Because RTF files contain only text, it is possible to generate them<br />

directly, <strong>and</strong> existing ones can easily be modified.<br />

Because the format is documented <strong>and</strong> freely available, RTF is readable by more software<br />

than Word’s binary format. Be aware, though, that users opening a complex RTF<br />

file in older versions of Word or different word processors will often see somewhat different<br />

results. Each new version of Word introduces new keywords to RTF, so older<br />

implementations usually ignore controls they do not underst<strong>and</strong> or have chosen not to<br />

implement.<br />

From the original list, an RTF certificate would be easy to design using Word or<br />

another word processor; is able to contain a variety of different elements such as vector<br />

<strong>and</strong> bitmap images; gives a high-quality printout; can be generated easily <strong>and</strong> quickly;<br />

<strong>and</strong> can be delivered electronically at low cost.<br />

This format works with a variety of applications <strong>and</strong> operating systems, although with<br />

somewhat variable results. On the downside, an RTF document can be easily <strong>and</strong> freely<br />

modified by anybody, which is a problem for a certificate <strong>and</strong> some other types of documents.The<br />

file size might be moderately large for complex documents.<br />

RTF is a good option for many document delivery applications, so you can use it as<br />

one option here.<br />

PostScript<br />

PostScript, from Adobe, is a page description language. It is a powerful <strong>and</strong> complex programming<br />

language intended to represent documents in a device-independent way—that<br />

is, a description that will produce consistent results across different devices such as printers<br />

<strong>and</strong> screens. It is very well documented. At least three full-length books are available,<br />

as well as countless <strong>Web</strong> sites.<br />

A PostScript document can contain very precise formatting, text, images, embedded<br />

fonts, <strong>and</strong> other elements.You can easily generate a PostScript document from an application<br />

by printing it to a PostScript printer driver. If you are interested, you can even<br />

learn to program in it directly.<br />

PostScript documents are quite portable.They give consistent high-quality printouts<br />

from different devices <strong>and</strong> different operating systems.

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

Saved successfully!

Ooh no, something went wrong!