in reply to Extract certain pages from a multi page PDF doc help!
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; my ($page_start,$page_end); $mw->Label(-text => 'Start' )->grid(-row => 0, -column => 0 +); $mw->Entry(-textvariable => \$page_start )->grid(-row => 0, -column + => 1); $mw->Label(-text => 'End' )->grid(-row => 1, -column => 0); $mw->Entry(-textvariable => \$page_end )->grid(-row => 1, -column => 1 +); my $bframe = $mw->Frame(-border => 1)->grid(); my $button = $bframe->Button(-text => 'Ok', -bg => 'hotpink', -command => \&get_pdfs )->grid(); MainLoop; sub get_pdfs{ print "Start $page_start \t\t End $page_end\n"; #untested string concantations, but you should get the idea # system ( pdftk A=100p-inputfile.pdf cat A22-36 output outfile_p22-p +36.pdf ) # system ( "pdftk A=100p-inputfile.pdf cat A.$page_start-$page_end ou +tput outfile_p$page_start-p$page_end.pdf ) print "Done\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extract certain pages from a multi page PDF doc help!
by Anonymous Monk on Oct 22, 2010 at 14:14 UTC |