Re: Individual pages from complete PDF

"spinningwebz2002" <spinningwebz2002-/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.pdfapi2
Message-ID <[email protected]>
--- In [email protected], "Mr. Shawn H. Corey" 
<shawnhcorey@...> wrote:
>
> spinningwebz2002 wrote:
> > After creating a document using PDF::API2, is there an "easy" way 
to 
> > generate individual pages from the pdf I just created without 
having to 
> > recreate the whole pdf?
> > 
> > For example I have just created and saved a pdf file 
> > called "example.pdf"
> > 
> > I would like to open it and save page 1 as "example-1.pdf", page 
2 
> > as "example-2.pdf" etc.
> 
>   # not tested
>   my $pdf->open('example.pdf');
>   my $pages = $pdf->pages();
>   for my $i ( 1 .. $pages ){
>     my $newpdf = PDF::API2->new;
>     my $page = $newpdf->importpage( $pdf, $i );
>     $newpdf->saveas( "example-$i.pdf" );
>   }
> 
> 
> -- 
> Just my 0.00000002 million dollars worth,
>    Shawn
> 
> "For the things we have to learn before we can do them, we learn by 
doing them."
>   Aristotle
>

Would I have to re-open the pdf if I just saved it? Is all the 
information I need still in memory?

Bill H
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.