When I ran your code it produced a document with two pages but the page labels were both on the first page. You need to get a text object from the 2nd page so you can add text to it. The text object you are using is from the first page so that's where the text goes.
#!c:/perl/bin/perl -w use strict; use PDF::API2; my $pdf=PDF::API2->new; # Create a new top-level PDF document my $font = $pdf->corefont('Helvetica'); my ($page, $text); $page=$pdf->page(); # Create 1st page $page->mediabox(500, 700); # Set the page dimensions $text=$page->text(); $text->translate(50, 650); # Position the text $text->font($font,12); $text->text("Page 1"); $page=$pdf->page(); # Create 2nd page $page->mediabox(500, 700); # Set the page dimensions $text = $page->text(); $text->translate(50, 650); # Position the text $text->font($font,12); $text->text("Page 2"); $pdf->saveas("file.pdf"); $pdf->end; exit;
cheers,
J
In reply to Re: PDF-API2 Basic Question
by edoc
in thread PDF-API2 Basic Question
by jstrat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |