merge pdf files

Join several PDF files into one, and take pages out of one.

  • files

Steps

  1. pdfunite a.pdf b.pdf c.pdf all.pdf

    join them in that order (poppler-utils)

  2. qpdf --empty --pages a.pdf b.pdf -- all.pdf

    the same with qpdf

  3. qpdf in.pdf --pages . 1-3 -- first.pdf

    keep only pages 1 to 3

  4. gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=all.pdf a.pdf b.pdf

    with Ghostscript, which also shrinks them

Commands used

  • pdfunite
  • qpdf
  • gs

Each has a page in lore: lore pdfunite opens it.