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";
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.