in reply to PDF::API2 is confusing me to death..
I you want to add a new page, you are correct in using the $pdf->page() method, but you need to tell it what page to create. By default it will just give you the first page (and create it if it doesn't exist). So doing something like this (untested):
-- More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk. -- Bruce Schneier
Is probably more like what you want.$page_num = 1; while ($files[$counter] ne "") { print("Encoding $files[$counter] to PDF format\n"); open(INFILE, "$startdir/$files[$counter]"); $line=<INFILE>; while($line ne "") { $txt->translate($xc,$yc); $yc-=10; if($yc==0){ $pdf->page($page_count); $txt = $page->hybrid; $txt->textstart; $txt->font($fnt, 10); $page->mediabox('LETTER'); $yc=780; } $txt->text($line); $counter++; $line=<INFILE>; } }
-- More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk. -- Bruce Schneier
In Section
Seekers of Perl Wisdom