in reply to blank pdf generated using PDF::API2
Hello lennelei
Welcome to the mnonastery. Try to use PDF::API2/PAGE METHODS/import_page(), it should work I tested on mine. Sample of working code:
Update: Minor note there is no importpage() method you probably mean import_page() which is working as expected, see sample code bellow.
#!/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->numPages(); for my $page_nb (1..8) { $newpdf->import_page($oldpdf, $page_nb, $page_nb); } $newpdf->saveas("test_2.pdf"); }
Hope this helps, BR.
|
|---|