PHP
  Home arrow PHP arrow Constructing Multi-Line PDF Documents ...
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 
IBM Rational Software Development Conference
 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

Constructing Multi-Line PDF Documents with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2007-11-06

    Table of Contents:
  • Constructing Multi-Line PDF Documents with PHP 5
  • Review: building basic PDF documents using PHP 5
  • Displaying multiple lines of text on a single PDF document
  • Building a multi-line PDF document using the set_text_pos() method

  • 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

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    Constructing Multi-Line PDF Documents with PHP 5
    (Page 1 of 4 )

    If you’re a PHP developer interested in developing web applications that deliver the contents of their database tables in PDF format, then hopefully this group of articles will be what you’re looking for. Welcome to the second article of the series “Building PDF documents with PHP 5.” Composed of five instructive tutorials, this series shows you the basics for creating PDF files directly from your own PHP 5 scripts, and complements the theoretical concepts with copious hands-on examples.

    Having introduced you to the main subject of this series, now let me refresh your memory of the topics that were discussed in the previous tutorial. In that article, we learned that creating primitive PDF documents using PHP is a process that’s reduced to spawning a new instance of the “PDFlib” class that comes bundled with the popular “PDFLib” library, and then calling one or more of its pertinent methods to open a new PDF document and a page, which usually need to include some basic contents in them, like text strings and images as well.

    With regard to specifying the dimensions of the PDF page that will be used for constructing the corresponding document, the “PDFLib” package offers the handy “begin_page_ext()” method. It's useful for creating PDF pages of different sizes, including some popular formats, like A3, A4, and A5.

    In addition, you saw how to include some basic texts into several PDF files by using a combination of the “set_text_pos()” and “show()” methods. Naturally these are packaged with the “PDFLib” library. In this way you learned some of the most common tasks associated with the creation of PDF files.

    However, to be frank, I'm just starting to scratch the surface when it comes to building PDF files with PHP 5. There are many other helpful methods, provided by aforementioned “PDFLib” package. Thus, in this second part of the series I’ll provide you with some examples that illustrate how to build PDF files that contain multiple lines of text; remember,  in the preceding article I worked only with single-line strings. Additionally, I'll teach you how to position these texts on a given PDF page.

    With the preliminaries out of the way, it’s time to continue learning more about building PDF files with PHP 5. Let’s go!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this second installment of the series, you’ll learn the basics on...
     

       

    PHP ARTICLES

    - 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
    - Working with Multiple Document Nodes with th...




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