I have been trying to create a pdf munger in perl that reorders pages into a new copy, so that i can print doublesided pages, two up in the correct order...
The script I wrote works seamlessly on small pdfs (up to 50 pages). I tried it on the large file i want (122 pages), and it didn't seem to work at all.
My proposed solution was to chunk up the file into smaller parts. I wrote a smaller script, that simply iterates the large file copying chunks of pages to new files.
It also hung indefinately. I made some diagnostic messages, and trimmed the complexity further and it turned out that
$pdf->importpage($pdf2,$i,0);
is what hangs. The process consumes huge amounts of memory (700 MB virtual), for a 9MB pdf. Aside from that I know nothing. $pdf is the new file, and $pdf2 is the old one. $i is a page number, and 0 means append, as documented.
Anybody know what can be done?
-nuffin
zz zZ Z Z #!perl