Book Image

PHP Programming with PEAR

By : Carsten Lucke, Stoyan Stefanov
Book Image

PHP Programming with PEAR

By: Carsten Lucke, Stoyan Stefanov

Overview of this book

<p>PEAR is the PHP Extension and Application Repository, and is a framework and distribution system for reusable, high-quality PHP components, available in the form of "packages". <br /><br />In this book, you will learn how to use a number of the most powerful PEAR packages available to boost your PHP development productivity. By focusing on these packages for key development activities, this book is an in-depth guide to getting the most from these powerful coding resources.<br /><br />You will become a master of various PEAR packages that help you with the essential tasks of PHP development such as:<br /><br />•&nbsp;&nbsp;&nbsp; Accessing databases with MDB2<br />•&nbsp;&nbsp;&nbsp; Displaying data in a range of formats (HTML, Excel spreadsheet, PDF)<br />•&nbsp;&nbsp;&nbsp; Creating and parsing XML documents<br />•&nbsp;&nbsp;&nbsp; Serializing PHP objects into XML, and unserializing XML documents to PHP objects<br />•&nbsp;&nbsp;&nbsp; Consuming and offering web services<br />•&nbsp;&nbsp;&nbsp; Accessing Web APIs including Google, Yahoo, Amazon, and Technorati</p>
Table of Contents (10 chapters)

Generating PDF Files


When discussing file formats, something must be said about the PDF format. PDF (Portable Document Format) is the 600-Pound gorilla of file documents. Originally a proprietary document format created by Adobe, PDFs have gained popularity as solving a specific problem, that is to create a document and be assured that it will look exactly the same on any system that the document is viewed on.

Unfortunately, there is a cost to the portability of PDF documents. It is an extremely complex format and is notoriously difficult to decipher, even for those who read the 1,000+ pages of the specification.

Thankfully, as PEAR users, we don't have to worry about reading the lengthy technical specification and can simply use the File_PDF library to handle our PDF creation needs. With a simple API we are able to do the majority of the tasks that present themselves, including displaying text, drawing lines and other objects, displaying images, writing to tables, etc.

The following is...