[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT - stitching together 2 pdf files



On Tue, Jul 12, 2011 at 06:28:02PM +0000, Camaleón wrote:
> On Tue, 12 Jul 2011 13:59:55 -0300, Facundo Aguirre wrote:
> 
> > On Tue, Jul 12, 2011 at 05:34:00PM +0100, AG wrote:
> 
> >> Sorry for the OT, but does anyone know of a way to stitch 2 separate
> >> pdf files together to make one large one?
> >> 
> >> I'm pretty sure acroread won't, but I was wondering about Xpdf or
> >> possibly a command-line approach?
> >> 
> >> Thanks for any help.
> 
> > Try this (you need the ghostscript package):
> > 
> > gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf
> 
> +1 for this.
> 
> That's also my one-liner to get the job done :-)

IME, this sometimes causes problems.  Because it's run through gs,
it's (TTBOMK) converted from PDF to PS, and then back again,
which can seriously bloat some PDF files.  I've had some increase
from a few MiB to hundreds of MiB using this method.

Obviously depends upon the individual PDF file, but there must
be some means by which PDF represents things much more compactly
which gs expands and then doesn't have the intelligence to
undo when it comes to writing the outout PDF.

pdftk, OTOH, works on the PDF directly without any need for
conversion (internally) into a different format and back again.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: signature.asc
Description: Digital signature


Reply to: