Merge Multiple PDF Files Into One PDF using Poppler pdfunite

Merge Multiple PDF Files Into One PDF using Poppler pdfunite

Sometimes you may need to combine multiple PDF documents into a single file for easier sharing, printing, or archiving. Manually merging PDFs using online tools may not always be secure or efficient, particularly for sensitive files. Fortunately, the pdfunite command line tool, which is part of the Poppler utilities, provides a simple and fast way to merge PDFs. This tutorial explains how to merge multiple PDF files into one PDF using Poppler pdfunite.

Prepare environment

Before using pdfunite, ensure that Poppler utilities are installed on the machine. If you are using Ubuntu, you can follow the installation guide.

Merging PDFs

Download a few sample PDF files to practice merging:

curl -sSo test1.pdf https://raw.githubusercontent.com/py-pdf/sample-files/master/004-pdflatex-4-pages/pdflatex-4-pages.pdf
curl -sSo test2.pdf https://raw.githubusercontent.com/py-pdf/sample-files/master/014-outlines/mistitled_outlines_example.pdf

The pdfunite command allows you to combine two or more PDF files into a single document. Simply provide the input PDF files in the order you want them to appear, followed by the name of the output file:

pdfunite test1.pdf test2.pdf result.pdf

This command creates a new file named result.pdf containing the pages from both test1.pdf and test2.pdf in the order specified.

Leave a Comment

Cancel reply

Your email address will not be published.