PDF documents are commonly used for sharing and storing information, but there are times when you need to extract specific pages or ranges of pages from a PDF file. On Linux systems, this task can be easily accomplished using the command line utility called jpdfkit. In this article, we will guide you through the process of splitting PDF files using jpdfkit on a Linux system.
Downloading jpdfkit
Before you can start splitting PDF files, you'll need to download and install jpdfkit. You can obtain it from the following website:
https://veryutils.com/java-pdf-toolkit-jpdfkit
Once you've downloaded the jpdfkit utility, make sure to place it in a directory where it can be easily accessed from the command line.
Splitting PDF Files Using jpdfkit
jpdfkit provides a simple yet powerful set of commands to split PDF files. Here are some common examples of how to use it:
1. Extract a Single Page
To extract a single page from a PDF file and save it as a new PDF document, use the following command:
$ java -jar jpdfkit.jar ORIG_FILE.pdf cat 5 output NEW_FILE.pdf
In this example, replace ORIG_FILE.pdf with the name of your source PDF file, 5 with the page number you want to extract, and NEW_FILE.pdf with the desired name for the output PDF.
2. Extract Multiple Individual Pages
To extract multiple individual pages and save them as a new PDF document, specify the page numbers separated by spaces:
$ java -jar jpdfkit.jar ORIG_FILE.pdf cat 1 4 6 output NEW_FILE.pdf
In this example, pages 1, 4, and 6 from ORIG_FILE.pdf will be extracted and saved as NEW_FILE.pdf.
3. Extract a Range of Pages
To extract a range of pages and save them as a new PDF document, use the following command:
$ java -jar jpdfkit.jar ORIG_FILE.pdf cat 1-5 output NEW_FILE.pdf
In this example, pages 1 through 5 from ORIG_FILE.pdf will be extracted and saved as NEW_FILE.pdf.
4. Extract a Combination of Pages and Ranges
You can also extract a combination of individual pages and ranges in a single command:
$ java -jar jpdfkit.jar ORIG_FILE.pdf cat 1 5 7 10-12 output NEW_FILE.pdf
This command will extract pages 1, 5, and 7, as well as pages 10 through 12 from ORIG_FILE.pdf and save them as NEW_FILE.pdf.
Please find more Java PDF Toolkit (jpdfkit) Command Line examples from following web page,
https://veryutils.com/blog/java-pdf-toolkit-jpdfkit-command-line-examples/
Splitting PDF files on a Linux system using jpdfkit's command line utility is a straightforward process. Whether you need to extract individual pages or specific ranges, jpdfkit provides the flexibility and functionality to meet your needs. With the examples provided in this article, you can easily manipulate PDF files to create new documents tailored to your requirements.
✅ Want to buy this product from VeryUtils?
If you are interested in purchasing this software or developing a customized software based on it, please do not hesitate to contact us.
We look forward to the opportunity of working with you and providing developer assistance if required.