| [reply] |
Just in case you were looking for an idea on how to make pdftk a bit more user friendly, you could take this as a start. Of course there are all sorts of details to account for, like input file name, extracting a single page, trying to extract an illegal range of pages, etc. etc. etc. But that is why writing a good gui takes some time and effort. :-)
#!/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";
}
| [reply] [d/l] |
#!/usr/bin/perl -w
use strict;
use PDF::Extract;
my $pdf;
$pdf=new PDF::Extract( PDFDoc=>"the.pdf");
$pdf->savePDFExtract(PDFPages=>"1 3", PDFCache=>"directory_to" );
| [reply] [d/l] |
| [reply] |
Hello,
I cannot tell if you need a web UI or a traditional gui? Either way, I would use PDF::Extract from CPAN. Please go and read the doc on it. If you need a traditional GUI, I would use wxPerl. Cross-platform and has a native look and feel of the platform you are using.
| [reply] |