Here is the code with the changes to enable it to work with PDF::API2 2.020 (and removing the fixed page count)
#!/usr/bin/perl use strict; use warnings; use PDF::API2; my $file='test.pdf'; my $newpdf = PDF::API2->new(); my $oldpdf = PDF::API2->open($file); if ($oldpdf->pages() > 1) { printf " (%d pages)\n", $oldpdf->pages(); for my $page_nb (1..$oldpdf->pages) { $newpdf->importpage($oldpdf, $page_nb, $page_nb); } $newpdf->saveas("test_2.pdf"); }
One suspects that there is something peculiar about lennelei's PDF other than the number of pages which is causing it to have trouble. Without the real input data it will be hard to debug.
Update: It appears that my spidey-sense is again uncannily prescient.
In reply to Re^6: blank pdf generated using PDF::API2
by hippo
in thread blank pdf generated using PDF::API2
by lennelei
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |