You’ve most likely received PDF files previously and may have a large number of PDF documents on your machine. It’s not possible to delete them, and backing them up could take up a lot of storage space. Combining/merging numerous PDF files into a single PDF file makes it easier to maintain, access, and back up. PDFtk Server is a command-line utility that lets you merge many PDF files into a single document.
How PDFtk Works
The acronym PDFtk stands for “PDF Toolkit.” You may use PDFtk Server to combine PDF documents, split PDF pages into new documents, rotate PDF pages, decode and encrypt PDF pages, update information, add watermarks, and much more. It’s open-source software that runs on Windows, Linux, and Mac OS X. The best part is that it doesn’t require Adobe Acrobat or any other Adobe products to function.
Note that there is also a PDFtk Free version, but it is only for Windows. It’s a graphical interface that lets you combine many PDF files into a single document.
How to Install PDFtk on Linux
For Linux (using Ubuntu), you can install it with the command:
PDFtk is also available in most repositories, so you can easily install it from your package manager/software center.
Using PDFtk to Combine Multiple PDFs
1. Once you’ve installed PDFtk, you’ll need to execute it from the command line, so open a terminal window.
2. Navigate to the location where your PDF files are stored:
3. Arrange the PDF files in the final document in the order you want them to appear. When you type the command line string, keep that order in mind.
4. Type the following string, in the order you wish your PDF files to appear:
That’s all there is to it. Make sure to double-check the new PDF file to ensure that all of the new pages are visible. The process is painless and seamless, and it should work with any ordinary PDF files you have.
Use wildcards (*) to combine many documents in a directory without listing each one individually:
How to Split, Encrypt, and Decrypt PDFs Using PDFtk
PDFtk can also be used for a variety of other activities. Run the following command, for example, to split a PDF file’s pages into numerous documents:
This will divide the document into individual pages, which you can subsequently alter as needed.
You may even combine pages from different documents into one new document with PDFtk. Simply type in the following command:
The letters “A” and “B” are utilized as “handles” for the names of your papers in this scenario. You are free to use as many as you require.
Use the following command to encrypt your new PDF file:
The password you use to encrypt the file is “foopass.” For your own use, switch to a more secure password.
If you have an encrypted PDF file, however, you can use PDFtk to decrypt it:
This only touches the surface of the many functions of PDF manipulation available with pdftk. You can use
pdftk --help or access their online examples to get a good overview of the command.
Using PDFtk Free on Windows
While the command line version of PDFtk is available for Windows, PDFtk Free provides a more user-friendly graphical interface. The best part is that PDFtk Server and PDFtk Free are both included in a single installation, so you get the best of both worlds. You may select either option. The instructions below, however, are for PDFtk Free.
The free edition doesn’t have as many features as the paid version, but it still merges PDFs. If you want to upgrade to premium, it’ll just cost you $3.99.
To add the PDF files you want to merge, click “Add PDF.” The order in which the files are added to the list is determined by the order in which they are selected, but you don’t need to worry about that for now.
Simply drag and drop the files into the desired order once they’ve been added. You can also select whatever pages you want to copy in your merged PDF by double-clicking the “Pages to Copy” field. To copy a selection and add it twice or remove it, use the “Copy Selection” and “Remove Selection” buttons.
When you’re finished, click the “Create PDF” button at the bottom of the window. In the “Afterwards” drop-down box, you can additionally choose to open the freshly created PDF or show the location of the PDF.
Using PDF Arranger to Merge PDF Files on Linux and Windows
PDF Arranger is another tool you can use to merge PDF files if you find PDFtk too difficult.
PDF Arranger is a fork of the old pdfshuffler and is a little python-gtk application that allows users to combine, divide, rotate, crop, and rearrange PDF documents using a simple graphical interface.
PDF Arranger can be downloaded through the Software Center or through your package manager. You can get the msi installer for Windows here.
1. Run PDF Arranger after it has been installed.
2. Select “Open a file” from the drop-down menu. Choose the PDF files you’d want to merge.
3. Drag the PDF pages around to rearrange them. You can also remove pages from the document, rotate it, and crop it.
4. Save it to a new file when you’re finished.
Beyond Merging PDFs
While merging PDFs is useful, there’s a lot more that PDFtk can do. Naturally, PDFtk Free has limitations, but you can divide PDFs with both PDFtk Server and PDFtk Free.
1. Select the PDF you wish to split using PDFtk Free.
2. Double-click the field labeled “Pages to Copy.”
3. Choose the page numbers or a range of page numbers for the first portion you’d like to separate. To prevent replacing the original PDF, save the divided piece with a different name.
4. Split the file into many portions by repeating the process.
You’ll need to remove pages from the output file on Linux. You are free to delete as many pages as you want. As an example, consider the following:
Other things you can do with PDFtk Free include:
- Rotate (premium only)
- Add stamps or watermarks (premium only)
- Encrypt documents (premium only)
Other things you can do with PDFtk Server (both Linux and Windows) include:
- Rotate pages
- Encrypt and decrypt pages
- Fill out PDF forms
- Add stamps and watermarks
- Repair corrupted files (not always possible butdoes recover the file if possible)
- Add PDF bookmarks and metadata
- Break a PDF into single pages
- Unpack attachments
- Attach files to PDF documents
As you can see, this fairly basic application is capable of much more than just merging PDF files. It’s a terrific all-in-one PDF application once you get the hang of the commands.
Frequently Asked Questions
1. How can I make using the command-line version of PDFtk easier on Windows?
Typing the complete file path name is the most challenging part. Open the GUI version, drag and drop your files into it, then drag and drop them one by one into the command prompt to copy the file path.
2. What PDFtk commands are available?
While command-line examples are provided above, the PDFtk Server Manual provides a more in-depth look at the many commands available to interact with all of the capabilities.
3. Is PDFtk Really Free?
Yes, but there are also premium options. The full GUI version of PDFtk Pro is available for purchase, however it is not required to merge or split PDFs.
You can also buy a one-year service agreement for $79/year if you need commercial support for a business.
Use PDFtk to merge PDF files if you’re bored of trying to organize related PDFs in folders. PDF Labs has a lot of documentation and videos to assist you learn how to use the command line tools. If you prefer to work with a graphical interface, you can alternatively utilize PDF Arranger.