PHP
  Home arrow PHP arrow Working with Images and Text Flows in ...
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

Working with Images and Text Flows in PDF Files with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2007-11-13

    Table of Contents:
  • Working with Images and Text Flows in PDF Files with PHP 5
  • Listing the source code of some previous examples
  • Displaying a basic image
  • Displaying a basic text flow

  • 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.

    Working with Images and Text Flows in PDF Files with PHP 5
    (Page 1 of 4 )

    When it comes to developing database-driven web applications that deliver their contents to end users in a great variety of formats, PHP can be a killer scripting language. This becomes even more evident when these contents must be displayed through one or more PDF files, which have to be built dynamically before being sent to the client. So if you want to learn how to start building PDF documents in PHP 5, then you should begin reading this article now!

    Welcome to the third article of the series that began with "Building PDF Documents with PHP 5." Composed of five approachable tutorials, this series takes you through using the most relevant methods that come packaged with the popular "PDFlib" library to create content-rich PDF files directly from inside your own PHP 5 scripts. It complements the corresponding theory with many educational code samples.

    Now that you know the subject of this series, I'm going to spend some time refreshing the topics that I covered in the previous tutorial. This will help you to establish an appropriate continuity between it and the current one that you're hopefully reading with interest.

    As you'll surely recall, in the second part of the series I showed you how to use a number of straightforward methods that come bundled with the aforementioned "PDFlib" package to build a few basic PDF documents that contained some basic texts. In this case, the text in question was distributed primitively across multiple lines by using a combination of the "set_text_pos()", "show()", and "continue_text()" methods respectively. This came in handy for performing some common tasks, such as specifying what X and Y coordinates should be used on the PDF document to display this text, and that it should be distributed in several chunks of strings.

    Of course, due to the easy learning curve offered by many of the methods included with the PDFlib library, performing the tasks from a simple PHP 5 script shouldn't be a major concern for you, and should be tackled with minimal hassles.

    So far, so good. At this point, you hopefully recall how to use the previous methods to display multiple lines of text in a concrete PDF file, so it's time to learn a few more method bundled with the library. As you'll see in the next few lines, these methods can be quite helpful for performing other tasks, like including images and blocks of texts into the PDF file in question.

    So, are you ready to find out how to incorporate graphics and blocks of strings into a specific PDF document with PHP 5? Well, let's not waste more time in preliminaries and begin this educational journey now!

    More PHP Articles
    More By Alejandro Gervasio


       · If you read the two previous installments of this series, most likely you’ll want to...
       · I am using your articles to learn to use PDFlib but I am getting an error with the...
       · Thank you for posting your comments on my PHP article. Concerning your question,...
       · I have tried to load the image using the full url, as I posted before, using the...
       · Thanks again for the comments. Here’s an example that worked on my system, and...
     

       

    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 6 hosted by Hostway