I'm trying to use PDF::API2 to turn a pdf document into many.
I am doing one doc out per page.
Thus, if the source is file.pdf, I want file_page1.pdf file_page2.pdf etc.
This is my test script..
#!/usr/bin/perl use strict; use PDF::API2; my $file_in = $ARGV[0]; my $prepend = $ARGV[1]; $prepend ||= 'out'; my $pdf_in = PDF::API2->open($file_in) or die; my $count = $pdf_in->pages; for my $i ( 0 .. ( $count - 1 )){ my $_i = ($i+1); my $file_out = "$file_in.$_i.pdf"; my $pdf_out = PDF::API2->new or die; $pdf_out->importpage( $pdf_in, $_i ) or die; $pdf_out->saveas($file_out) or die; print STDERR "saved $file_out\n"; } exit;
What's bugging me is that I get a PDF::API2 error..
leo@pony devel$ ./t/00bust.pl ./t/scan1.pdf Can't call method "outfilt" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/PDF/API2/Util.pm line 688.
Is this a possible bug, or am I doing this wrong?
I tried a few different pdf sources, same trouble.
Here's one pdf source I tried: http://web.aces.uiuc.edu/vista/pdf_pubs/ICESTORM.PDF
I have the latest PDF::API2 from cpan.
Update
Failure happens on i386 machine.
I tested on x86_64 machine with PDF::API2 version 2.006, worked. I updated to version 2.015, tried again and it worked fine- still. Must be something else then- a dep.. ..
In reply to PDF::API2 importpage problem by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |