PDF::API2::Simple

PDF::API2::Simple is a simplistic wrapper for the excellent PDF::API2 modules.
Download

PDF::API2::Simple Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Public Domain
  • Price:
  • FREE
  • Publisher Name:
  • Red Tree Systems, LLC
  • Publisher web site:
  • http://ptest.redtreesystems.com/

PDF::API2::Simple Tags


PDF::API2::Simple Description

PDF::API2::Simple is a simplistic wrapper for the excellent PDF::API2 modules. PDF::API2::Simple is a simplistic wrapper for the excellent PDF::API2 modules.SYNOPSIS use PDF::API2::Simple; my $pdf = PDF::API2::Simple->new( file => 'output.pdf' ); $pdf->add_font('VerdanaBold'); $pdf->add_font('Verdana'); $pdf->add_page(); $pdf->link( 'http://search.cpan.org', 'A Hyperlink', x => 350, y => $pdf->height - 150 ); for (my $i = 0; $i < 250; $i++) { my $text = "$i - All work and no play makes Jack a dull boy"; $pdf->text($text, autoflow => 'on'); } $pdf->save();Take note that PDF coordinates are not quite what you're used to. The coordinate, (0, 0) for instance is at the lower-left hand corner. Thus, x still grows to the right, but y grows towards the top.METHODSnew PDF::API2::Simple->new( 'file' => 'output.txt', 'width' => 612, 'height' => 792, 'line_height' => 10, 'margin_left' => 20, 'margin_top' => 20, 'margin_right' => 20, 'margin_bottom' => 50, 'width_right' => 0, 'height_bottom' => 0, 'effective_width' => 0, 'effective_height' => 0, 'header' => undef, 'footer' => undef, );Creates a new PDF::API2::Simple instance. A good strategy is to create a new object for each pdf file you want to create. That is, of course, up to you.file - The PDF file you want to write to. No default, parameter requiredwidth - The width of the PDF file. Defaults to 612, the 8 1/2 x 11 US Letter widthheight - The height of the PDF file. Defaults to 792, the 8 1/2 x 11 US Letter heightline_height - The standard height you want to define for lines. The default is 10margin_left - The amount of margin space you want on the left side. Of course, you can specify whatever coordniates you want. Default is 20margin_top - The amount of margin space you want on the top of each page. Default is 20margin_right - The amount of margin space you want of the right side of each page. Default is 20margin_bottom - The amount of margin space you want on the bottom of each page. Default is 50width_right - A convenience property that contains the furthest x of the page, accounting for the margins specifiedheight_bottom - A convenience property that contains the largest y of the page, accounting for the bottom margineffective_width - A convenience property that contains the width of the page, after the left and right margin have been accounted foreffective_height - A convenience property that contains the height of the page, after the top and bottom margin have been accounted forheader - This CODE reference will be called everytime a page is appended to the PDF, allowing you to specifiy a header for your pagesfooter - This CODE reference will be called everytime a page is ended, allowing you to specifiy a footer for your pagesopen PDF::API2::Simple->open( 'open_file' => 'my_pdf.pdf', 'open_page' => 1, # Default is 1. # Any other options to new. );This method opens an existing PDF for editing. You can include any other arguments that are valid for new and they will be set in the resulting object.Requirements:· Perl Requirements: · Perl


PDF::API2::Simple Related Software