PHP
  Home arrow PHP arrow Positioning Strings with the show_xy()...
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 
 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

Positioning Strings with the show_xy() Method in PDF Documents with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2007-11-27

    Table of Contents:
  • Positioning Strings with the show_xy() Method in PDF Documents with PHP 5
  • Inserting Blocks of Text
  • Going One Step Further
  • Completion

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

    Positioning Strings with the show_xy() Method in PDF Documents with PHP 5
    (Page 1 of 4 )

    As you know, more and more web sites try to engage their visitors by delivering their database contents in several formats, such as Adobe’s Portable Document Format (PDF). The good news regarding this topic is that you, as a PHP developer, can take advantage of this language’s versatility and get started quickly building PDF files directly from your own scripts.

    Welcome to the final installment of the series that began with “Building PDF Documents with PHP 5.” Composed of five educational tutorials, this series provides you with a friendly introduction to using the most important methods that come packaged with the popular “PDFlib” library and to performing some tasks associated with PDF files, such as creating and deleting documents on the fly, inserting blocks of texts and images, and working with single and multi-line strings.

    Having introduced you to the subject covered by this group of articles, it’s time to recapitulate briefly the topics that were discussed in the previous tutorial of the series. This way you’ll be able to see more easily how that article and the current one can link with each other.

    Getting straight to the point, hopefully you’ll recall that in the previous article I showed you how to use the helpful “rect()” method which comes integrated with the “PDFlib” package to draw some basic rectangles on a given sample PDF file.

    Indeed, as you saw for yourself, incorporating primitive shapes like the pertinent rectangles to an existing PDF file is an easy-to-follow process. It’s only limited to creating an instance of the already familiar “PDFlib” class that I used with all of the hands-on examples that you learned so far, and calling the adequate method responsible for drawing a specific shape.

    Nevertheless, regardless of the ease with which the “PDFlib” library can be used to perform different tasks, like drawing different shapes, inserting images, and so forth, undoubtedly the king of all of them is working with text. In truth, one of the most common challenges that an average PHP developer has to tackle when building PDF files from scratch consists of creating PDF documents whose contents are mostly composed of simple text.

    Considering this fact, this last installment of the series will be entirely focused on using a handy method that naturally belongs to the “PDFlib” library, called “show_xy()”, which allows you to display complete blocks of text at different positions within a given PDF document, by using only a couple of X,Y coordinates.

    So, are you ready to learn how to use the “show_xy()” method to create text-based PDF files? Well, let’s not waste more time in preliminaries and begin now!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this last installment of the series, you’ll learn how to use the...
     

       

    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