Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Re: editing pdf files with perl
- Bill Segraves
February 17, 2005, 4:14 am
rate this thread
> > So why does this not qualify as an appropriate question for this group?
> > It certainly looks like a miscellaneous perl question to me...
O.K. Here's a Perl script that uses Pdftk to merge an FDF file into a PDF
file, which could provide a command-line solution for the OP (Tested on this
# usage - ..\bin\perl pdftk.pl inpdf=sam_hdrftr.pdf
# note - all files used in this example reside in c:\indigoperl\tmp on this
use CGI qw(:param);
my $inpdf = param('inpdf');
my $infdf = param('infdf');
my $outpdf = param('outpdf');
#Example 4 - fill a PDF with the data in an FDF file
system('pdftk.exe', $inpdf, 'fill_form', $infdf, 'output', $outpdf);
See the documentation for Pdftk, www.accesspdf.com/pdftk, for any questions
on command syntax for Pdftk.
> >Plus I
> > want to know the answer but I'm lazy enough not to go to comp.text.pdf
> > to get it. :-) Thanks. - pikus
I hope you looked at the examples and documentation for Pdftk, where you
might have learned some of the resons why you shouldn't just routinely edit
a PDF file, even though it may "look" like a plain text file.
Re: editing pdf files with perl
I wish to thank everyone who took time out to read and answer my
doubt(s) here. Ultimately I used PDF::Reuse which served the purpose.
Bill, I visited your website and its a very useful place for people
working in the PDF-Perl Domain.
Thanks again. It has been a learning experience here. :o)