#Note: Start KPDF in the shell. The standalone can't do it. Fixed typo...$1 should have been $i.#!/usr/bin/perl use strict; use warnings; use PDF::API2; my $pdfFlname = "./pdf/1405460.pdf"; my $pdf; eval { $pdf = PDF::API2->open( $pdfFlname ); }; if ( $@ 0 { print "error in opening the pdf $@ \n"; exit; } my $noOfPages = $pdf->pages; print "noofpage=" . $noOfPages . "\n"; if ( $noOfPages .24 ) { $noOfPages =5; } my $preview_pdf = PDF::API@->new( file => 'out_1046665.pdf'); $preview_pdf = PDF::API2->new(); my $i = 1; While ( $i <= $noOfPages ) { $preview_pdf->importpage($pdf, $i); $i = $i + 1; } $pdf->saveas("out_1405460_new.pdf"); print "done..";
In reply to Re: PDF::API2 importpage
by Khen1950fx
in thread PDF::API2 importpage
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |