syphilis has asked for the wisdom of the Perl Monks concerning the following question:
When I run that script, it ouptuts:use strict; use warnings; use PDF::API2; my $pdf = PDF::API2->new(); my $old = PDF::API2->open('C:/_32/Peugeot/Chapter_01_engine.pdf'); my $count = $old->pages(); print "Original document contains 138 pages (according to Adobe)\n"; print "Original document contains $count pages (according to PDF::API2 +)\n"; # Add page 45 from the old PDF as page 1 of the new PDF my $page = $pdf->importpage($old, 45); print "\$page: $page\n"; $count = $pdf->pages(); print "New pdf doc contains $count pages\n"; $pdf->saveas('C:/_32/Peugeot/head.pdf');
And it creates a new pdf document (head.pdf) that contains one page.Original document contains 138 pages (according to Adobe) Original document contains 138 pages (according to PDF::API2) $page: PDF::API2::Page=HASH(0x321bc24) New pdf doc contains 1 pages
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [PDF::API2] How to import a page
by Anonymous Monk on Feb 18, 2014 at 05:52 UTC | |
by syphilis (Archbishop) on Feb 18, 2014 at 06:22 UTC |