PHP
  Home arrow PHP arrow Building PDF Documents with PHP 5
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
OLM
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Building PDF Documents with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 8
    2007-10-30

    Table of Contents:
  • Building PDF Documents with PHP 5
  • Building basic PDF documents with PHP 5 using an object-oriented approach
  • Working with different page sizes
  • Creating a basic A5 PDF document using PHP 5

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    PCmover - $15 Off with Coupon Code CJPH7Q

    Building PDF Documents with PHP 5
    (Page 1 of 4 )

    PHP is a versatile language with some surprising capabilities. It can even create PDF documents on the fly, with the right third-party PDF library. If you can't imagine why you'd want to do that, think about the various formats used by applications when retrieving data from databases -- and keep reading.

    Introduction

    As the enthusiastic PHP programmer that you surely are, you’ll certainly know that this mature server-side scripting language can be used in all sorts of clever ways to develop a huge variety of applications, including form validation systems, full-featured database abstraction layers, powerful error loggers, and so forth. And certainly, the list goes on and on.

    The flexibility and versatility offered by PHP is remarkable when it comes to building applications that will be used for different website development purposes. However, it isn’t my intention here to enumerate the thorough advantages of PHP. 

    Nonetheless, there’s one thing that I’d like to stress here with reference to the robust capabilities offered by PHP. As you probably heard, this powerful server-side scripting language has the venerable capacity (yes, that's the right adjective) for dynamically building PDF documents. This feature makes it suitable for use with web applications that deliver database contents in PDF files. 

    Of course, the ability to create PHP documents on the fly comes at a cost. PHP 5 currently doesn’t support this feature natively, which means that you'll need to download a third-party PDF library to start generating PDF files quickly. PHP’s official web site recommends the use of the popular PDFlib package, which offers support for multiple programming languages, such as Python, Perl, and naturally PHP. The down side to using this library is that you’ll have to pay a license to use it commercially.

    If you prefer, you can use an streamlined version of the PDFlib package, called “PDFlite,” but it lacks some important features which are present in the commercial version. In either case, you may want to first download this library (or another one of your choice), and then install it on your on testing server, and finally get started with building basic PDF documents directly from your PHP scripts.

    So, if creating dynamic PDF files with PHP 5 is an interesting topic to you, keep reading. In this series of articles I’ll show you how to start using the “PDFlib” package to build basic PDF documents. In upcoming articles I’ll cover other important characteristics, like including images into a PDF file, displaying blocks of text, and drawing basic shapes.

    Let’s not waste any more time in preliminaries. Click on the link below to start learning how to build dynamic PDF documents with PHP 5. Let’s begin now!

    More PHP Articles
    More By Alejandro Gervasio


       · In this first part of the series, you’ll learn how to build basic PDF files from...
     

       

    PHP ARTICLES

    - Setting Up a Web-based Image Hosting Service
    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway