Skip to content

Instantly share code, notes, and snippets.

@MidLifeXis
Created April 18, 2014 19:37
Show Gist options
  • Select an option

  • Save MidLifeXis/11060962 to your computer and use it in GitHub Desktop.

Select an option

Save MidLifeXis/11060962 to your computer and use it in GitHub Desktop.
my $doc = CAM::PDF->new( $cfg->infile );
printf( "read %s\n", $cfg->infile );
for my $p ( 1 .. $doc->numPages ) {
my $outfilename = $cfg->outfilebase;
$outfilename =~ s/XXXX/$p/;
printf( " extracting page %d\n", $p );
my $outdoc = CAM::PDF->new( $doc->toPDF );
$outdoc->extractPages( $p );
$outdoc->cleanoutput( $outfilename );
printf( " wrote %s (page %d)\n", $outfilename, $p );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment