I have a handful of PDFs I want to combine into a single PDF. I remember trying to solve this problem on OS X a few years ago, and found no (obvious) native tools to use, and a very few open source tools that could do the job. Eventually, I found some little open source applet written in RealBasic that worked the one time I needed it; I don't remember what it was, and probably never used it again.
Of course, that's totally lame. A real solution would involve something from CPAN and a couple of lines of Perl. For example, something like this:
#!/usr/bin/perl -w
use strict;
use PDF::Reuse;
my $output = shift(@ARGV);
prFile($output);
prDoc({file => $_}) foreach (@ARGV);
prEnd;
PDF::Reuse has lots of other features, including picking and choosing which pages of a PDF to reuse and merge. But for joining a whole mess of PDFs together into a single file, this works wonderfully.
Thanks, Lars!
Concatenating pdf documents (Score:1)
texexec --pdfarrange --result all.pdf file*.pdf
(or even using ghostscript
gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf
*.pdf
)
If you want more control over importing certain pages you can use the pdfpages package in latex; just run the following file (call it all.tex or whatever) through latex:
\documentc
nice! (Score:2)
Another option (Score:1)
% cpan install CAM::PDF
% appendpdf.pl file1.pdf file2.pdf out.pdf
or almost equivalently:
use CAM::PDF;
my $doc1 = CAM::PDF->new(shift);
my $doc2 = CAM::PDF->new(shift);
$doc1->appendPDF($doc2);
$doc1->cleanoutput(shift);
-- Chris
P.S. I'm the author of CAM::PDF
thanks (Score:1)