How to merge PDF files in Linux

A file in Portable Document Format is a file developed by Adobe with a .PDF file extension. PDF files not only contain images and text, but also interactive buttons, hyperlinks, embedded fonts, videos and more. You will often see product manuals, e-books, information sheets, job applications, scanned documents, brochures, and all other types of documents available in PDF format. Web pages can even be saved as PDF with full formatting for future reference. This article is about how to merge PDF Files in Linux.

Linux is an open source operating system like other operating systems like Microsoft Windows, Apple Mac OS, iOS, Google Android, etc. An operating system is software that enables communication between computer hardware and software. It carries inputs to be processed by the processor and gives outputs to the hardware for display. This is the basic function of an operating system. Although it performs many other important tasks, we will not talk about them.

2 Ways to Merge PDF Files in Linux Distros

Merge PDF Files Through pdftk Utility

Install pdftk utility

  • First, you need to install the pdftk utility using the following command in the terminal.

sudo apt-get to install pdftk

  • When you enter this command, it will ask for your permission to install it, so press “Y” and enter to continue

Let’s merge the PDF files

  • Using the following command, we will now merge the two PDF files.

pdftk file1.pdf file2.pdf cat output file3.pdf

  • Before the “cat” keyword, you can use as many PDF files as you want to merge followed by the name of the output PDF file.
  • Although it won’t show you any message, you can confirm if it worked or not by searching for “file3”
  • You can also merge all files in the directory by changing the command in the following way.

pdftk *.pdf output file cat3.pdf

Merge PDF Files Through the Poppler Utility

Install Poppler Utility

  • You can install the poppler utility by using the following command.

sudo apt-get install poppler-utils

Let’s Merge the PDF Files Using Poppler Utility

  • To merge the PDF files using the poppler utility, use the following command.

Pdfunite 2.pdf File2.pdf final.pdf

  • It won’t show any message, so you’ll have to go to the directory to confirm if it worked

Final Words

We hope you like our article on methods to combine 2 PDFs in Linux Distros. PDF files are essential for both personal and professional documents. There are several Linux GUI and command line tools that you can use to combine multiple PDF files into a single PDF file.

I hope you understand this article, How to merge PDF files in Linux.

Leave a Comment