PDF >
ImageMagick ∞
(convert is from ImageMagick)
-
Tested 2019-11-20 – 8:6.9.7.4+dfsg-11+deb9u7 on Debian 9.9.0-i386-xfce-CD-1
\sudo \apt-get install imagemagick \convert -verbose *.pdf target.pdf
poppler-utils (pdfunite) ∞
Spoiler
\sudo \apt-get install poppler-utils \pdfunite file1.pdf file2.pdf out.pdf # Or use shell pattern matching, like: # \pdfunite * out.pdf
pdftk ∞
https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ [ 1 ] was http://www.pdfhacks.com/pdftk/
Spoiler
Doesn’t seem to actually do anything
\sudo \apt-get install pdftk # verbose generates an error for some reason # \pdftk * out.pdf verbose # does nothing \pdftk * out.pdf
texexec ∞
I used the following command with texexec and it worked perfect except it changed to legal size paper instead of letter. But I was able to use Preview to crop it back to normal anyways.
\texexec --pdfarrange --paper=landscape --result trans.pdf Transcript003.pdf Transcript004.pdf
Multivalent ∞
Multivalent worked fine for me using Java 1.4:
java -classpath /path/to/Multivalent.jar tool.pdf.Merge *
If you don’t want to add that option every time, just do
setenv CLASSPATH $CLASSPATH:/path/to/Multivalent.jar # or export CLASSPATH=$CLASSPATH:/path/to/Multivalent.jar
Ghostscript ∞
\gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf ...
If the Ghostscript solution gives you seemingly randomly rotated pages, add -dAutoRotatePages=/None to the command line:
\gs -dAutoRotatePages=/None -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf ...
Perl ∞
(Perl)
http://studio.imagemagick.org/pipermail/magick-users/2006-June/017692.html (not archived)
It’s instantaneous.
Spoiler
#!/usr/bin/perl # # Name: # pdf-combiner.pl. use strict; use warnings; use PDF::Reuse; # ------------- prFile('combo.pdf'); # Output. for (qw/a b c d/) # Inputs. { prImage("result_$_.pdf"); prPage(); } prEnd();
pdfpages ∞
(pdflatex)
The script is for landscape but could easily be changed for portrait.
Spoiler
#!/bin/bash cat <<ENDTXT >__tmp__.tex \documentclass[landscape]{article} \usepackage{pdfpages} \begin{document} ENDTXT outnm=$1 count=`echo "$# - 1" |bc` for f in `seq $count`; do shift echo "\includepdf[pages=-]{$1}" >>__tmp__.tex done echo "\end{document}" >>__tmp__.tex pdflatex __tmp__.tex rm __tmp__.{tex,aux,log} mv __tmp__.pdf $outnm
Usage:
scriptname.sh <outputfile.pdf> <inputfile1.pdf> <inputfile2.pdf> ... <inputfile100.pdf>
pdf2ps ∞
pdf2ps x.pdf pdf2ps y.pdf pdf2ps z.pdf cat x.ps y.ps z.ps >big.ps ps2pdf big.ps
If you convert the PDFs to Postscript and back, you may end up with a PDF that is less than optimal.
pdfjam ∞
https://github.com/rrthomas/pdfjam [ 2 ] was https://github.com/DavidFirth/pdfjam [ 3 ] see https://warwick.ac.uk/fac/sci/statistics/staff/academic-research/firth/software [ 4 ] was https://warwick.ac.uk/fac/sci/statistics/staff/academic-research/firth/software/pdfjam [ 5 ] was https://www2.warwick.ac.uk/fac/sci/statistics/staff/academic/firth/software/pdfjam/
PDFjam is a small collection of shell scripts which provide a simple interface to some of the functionality of the excellent pdfpages package (by Andreas Matthias) for pdfLaTeX. At present the utilities available are:
pdfnup, which allows PDF files to be “n-upped” in roughly the way thatpsnupdoes for PostScript files.pdfjoin, which concatenates the pages of multiple PDF files together into a single file-
pdf90, which rotates the pages of one or more PDF files through 90 degrees (anti-clockwise).
In every case, source files are left unchanged.
A potential drawback of these utilities is that any hyperlinks in the source PDF are lost. On the positive side, there is no appreciable degradation of image quality in processing PDF files with thse programs, unlike some other indirect methods such as pdf2ps | psnup | ps2pdf (in the author’s experience). (Better than the rather indirect approach taken here would be filters that work directly on the PDF code, to produce output files with hyperlinks intact.)
Other/untested ∞
- PDF blender
- ConcatPDF
- fpdi1.1 (PHP)
- joinPDF (Java)
Footnotes

Moved some items from the [[PDF]] topic, and ported remaining notes.