Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: combining PDFs

by almut (Canon)
on Jun 30, 2010 at 19:52 UTC ( [id://847386]=note: print w/replies, xml ) Need Help??


in reply to Re^2: combining PDFs
in thread combining PDFs

Not sure I understand. Have you hardcoded those file names in the system call?  I would guess that you get the input file names from somewhere (listing directory contents, some config file, user input...).  Otherwise, how would the program work if there's a new date stamp...

So why not simply dynamically create the output file name according to the date stamp found in the input file?  For example:

my $in1 = "exhibit1_29JUN2010.pdf"; my $in2 = "exhibit2.pdf"; my ($date) = $in1 =~ /_([^_]+)\.pdf$/; # extract date my $out = "exhibits_$date.pdf"; # create output file name system "pdftk /home/Memos/$in1 /home/Memos/$in2 cat output /home/Memos +/$out";

Or maybe

my $dir = "/home/Memos"; my $in1 = <$dir/exhibit1_*.pdf>; my $in2 = "$dir/exhibit2.pdf"; my ($date) = $in1 =~ /_([^_]+)\.pdf$/; my $out = "$dir/exhibits_$date.pdf"; system "pdftk", $in1, $in2, "cat", "output", $out;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://847386]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-03-28 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found