The PDF::API2 package is used widely to create and manipulate PDF.
CODE:
use PDF::API2;
my $pdf = PDF::API2->new(-file => "HelloWorld.pdf");
$pdf->mediabox(595,842);
my $page = $pdf->page;
my $fnt = $pdf->corefont('Arial',-encoding => 'latin1');
my $txt = $page->text;
$txt->textstart;$txt->font($fnt, 20);
$txt->translate(100,800);
$txt->text("Hello Sheela! left-aligned");
$txt->translate(500,750);
$txt->text_right("Hello Sheela! right-aligned");
$txt->translate(300,700);$txt->text_center("Hello Sheela! center-aligned");
$txt->textend;$pdf->save;$pdf->end();
Tuesday, August 28, 2007
Use Perl to create PDF
Subscribe to:
Post Comments (Atom)
1 comment:
Dear sheela,
ur blog is very useful and nice.. All the perl tips in this differ from other site...
Expecting more interesting tips ..
Keep On Rocking!!!!
Friendly,
Anitha
Post a Comment