Edit PDF in Linux (split, merge, extract, rotate)
The PDF format serves to distribute documents in a universal format that can be viewed correctly in all operating systems. It is one of the most popular formats but a few users know how to edit PDF in Linux. Below you will learn how to merge, split, rotate pages in a PDF file in Linux. I will show how to do it using a very user-friendly graphical program.
PDF formats are indeed very popular. Even web browsers incorporate a PDF reader to make it easier to open PDF documents. The problem is however not with how to open PDFs but rather how to edit them. For example, even doing a simple thing like splitting PDF pages into several files can look impossible for new users. However, there is an application that helps with that task and beyond.
This program is called PDFsam and it is available in three different versions.
- PDFsam Basic provides the basic editing options of a PDF such as split, merge or rotate. It is usually available in all Linux distributions in the default repositories.
- PDFsam Enhanced comes with some additional features such as PDF review, OCR, sign etc. Unfortunately, this version is available for Windows only.
- PDFsam Visual includes some premium options such as visual compositing, reordering, splitting, merging, rotation, and cropping of PDF files. It is available for Linux but requires a paid license.
So, in this tutorial, I will use the free PDFsam basic version.
Install PDFsam Basic
As I have mentioned earlier, you can install PDFsam form the repository of your Linux distribution and edit PDF in Linux right away. But to have all the latest features and fewer bugs, I recommend installing the latest stable version from the official website.
Then, open your file browser and go to the Downloads folder. Next, open a terminal in the Downloads folder with the right mouse click (select the Open in terminal option) and install the package with the
1 sudo dpkg -i pdfsam_*_all.deb
Of course, you can install this deb package using the software manager, but it is more reliable to use the terminal. The terminal output has more information and it will show if any errors occurred during the installation
As you can see in the image above, the installation was without any error. I hope you get the same result.
PDFsam Basic interface
To edit PDF in Linux, open PDFsam from the menu of your distribution and you will see this interface.
It is a nice-looking program with all its functionality presented in this dashboard window:
- Split a PDF file into more parts.
- Merge several PDF documents.
- Mix PDF pages.
- Rotate PDF pages.
- Split PDF documents by bookmarks.
- Extract specific pages from a PDF.
- Finally, split PDFs based on size.
At the bottom, you can see the premium features that are available in PDFsam Visual. These features require a license as I explained above.
In my personal experience, the Split and Merge options are the most used. So, I will quickly show you those two.
Edit PDF in Linux with PDFsam
Split a PDF file
To split a file in PDFsam Basic, you select the split option on the main window and the following screen will be displayed.
As you can see, the interface is very intuitive. At the top, you have to upload the PDF file to Split by clicking on the Browse button.
Once you have chosen the PDF file you are going to work with, at the top of the screen, you will be able to see how many pages it has. Next, you define the Split settings. You can split by every page or the even pages.
Also, you can split after a specific page or split after a specific number of pages. For example, every 5 pages.
Finally, you define the folder where the new files will be output. You can also add a name prefix to the output files. Then, click on the Run button.
Once the process is complete, open the folder where you chose to output the files and you will see the spitted files with page numbers and defined prefix in their names.
As you can see, it is very simple to split a PDF file using PDFsam. I can also say it is very fast.
Merge a PDF file
The second most used option when editing PDFs in Linux is to merge two or more files.
Here, you add the files to be merged. You can do this by dragging your files from the file browser or by using the Add button.
One thing to keep in mind is that you can move files in this window to define the order in which they are going to be merged. You can do this by selecting the file and clicking on move up or move down buttons in the top bar.
Also, in the options section, you can configure the way the process is going to be done. It usually works well with the default settings.
Finally, click on the Run button and the files will be merged.
After that, you will see the resulting merge file in your file browser.
PDFsam also has other options which are as simple to use as split and merge. Please, try them yourself.
PDF files are useful for distributing documents that are visible on any device on any operating system. PDFsam makes editing PDF in Linux easy, simple and quick.
If you know of other better tools, let me know in the comments.
I believe you will also find useful my post about Firefox smooth scrolling.