Using Perl, how can I combine or merge the sample PDF files into a single PDF file?
+2
A:
You can use the GhostScript utility pdf2ps
to convert the PDFs into PostScript files, concatenate the PostScript files, and then use ps2pdf
to convert the result back into a PDF.
Adam Rosenfield
2009-01-07 05:05:50
Why the downvote? At least leave a reason...
Adam Rosenfield
2009-01-07 06:21:45
I think it's because your solution doesn't use Perl.
Nathan Fellman
2009-01-07 19:00:40
Just because it's not a native Perl solutions doesn't mean it isn't any good. Perl can very easily invoke other utilities via the shell.
Adam Rosenfield
2009-01-08 02:10:07
+10
A:
CAM::PDF can do this quite easily, and has a simple command-line front end to help. Note: I'm the author of that library. Example:
appendpdf.pl file1.pdf file2.pdf outfile.pdf
Chris Dolan
2009-01-07 05:07:08
+4
A:
Why do you need to do it from Perl? Chris has already mentioned CAM::PDF.
If you just need to merge them, pdftk (PDF ToolKit) works just fine. It's a simple command line:
pdftk file1.pdf file2.pdf cat output merged.pdf
brian d foy
2009-01-07 06:52:53