Perl Pdf Create

  1. Perl Pdf Create Rectangle
  2. Perl Pdf::create
  3. Perl Script Create Pdf

PDF::Create provides an easy module to create PDF output from your perl script. It is designed to be easy to use and simple to install and maintain. It provides a couple of subroutines to handle text, fonts, images and drawing primitives. Simple documents are easy to create with the supplied routines. Perl or Practical Extraction and Report Language is described by Larry Wall, Perl's author, as follows: 'Perl is an interpreted language optimized for scanning arbitrary text files, extracting information from those text files. Modperl is more than CGI scripting on steroids. It is a whole new way to create dynamic content by utilizing the full power of the Apache web server to create stateful sessions, customized user authentication systems, smart proxies and much more.

Create or modify PDF with a Perl script.

Many web sites use Perl for creating dynamic content. You can also use Perl to script Acrobat on your local machine [Hack #95] . Given the great number of packages that extend Perl, it is no surprise that packages exist for creating and manipulating PDF. Let's take a look.

6.14.1 Install Perl and the PDF::API2 Package on Windows

Perl Pdf Create

[Hack #95] explains how to install Perl on Windows. After installing Perl, use the Perl Package Manager to easily install the PDF::API2 package.

Launch the Programmer's Package Manager (PPM, formerly called Perl Package Manager) by selecting Start Programs ActiveState ActivePerl 5.8 Perl Package Manager. A command prompt will open with its ppm> prompt awaiting your command. Type help to see a list of commands. Type search pdf to see a list of available packages. To install PDF::API2, enter installpdf-api2. The Package Manager will fetch the package from the Internet and install it on your machine. The entire session looks something like this:


The PDF::API2 package is used widely to create and manipulate PDF. You can download documentation and examples from http://pdfapi2.sourceforge.net/dl/.

Pdf

6.14.2 Hello World in Perl

Perl Pdf Create Rectangle

This Perl script creates a PDF named HelloWorld.pdf, adds a page, and then adds text to that page. It gives you an idea of how easily you can create PDF. Figure 6-16 shows the PDF document created by this script.

CreatePerl Pdf Create
Figure 6-16. Creating PDF content using Perl

6.14.3 Discover Perl Packages with CPAN

Perl Pdf::create

Perl pdf::create

Perl Script Create Pdf

CPAN (http://www.cpan.org) is the Comprehensive Perl Archive Network, where you will find 'All Things Perl.' Visit http://search.cpan.org to discover several other PDF packages. Drill down to find details, documentation, and downloads. For example, PDF::Extract (http://search.cpan.org/~nsharrock/) creates a new PDF from the pages of a larger, input PDF.