Link

Split Pages From PDF

v2024.08

JPedal provides several methods to allow easy splitting of PDF files into multiple new files.
These tools will allow you to create multiple PDF files by splitting a given file into multiple new files. The original file is left untouched by this process.

Split a PDF into two files with the Command-Line or another language

java -cp jpedal.jar org.jpedal.tools.PdfPageSplit 
inputFile outputFile pageToSplitAt

The pageToSplitAt variable defines which page of the file to split at. The first half of the file contains the specified page.

Split PDF files in Java

Static Convenience Methods

//Split all pages into separate PDF files, all output has the same file name with the page number appended
PdfPageSplit.splitAllPages(new File("/path/to/input.pdf"), new File("/path/to/output-folder/"));

//Split the file into multiple new files with pagePerNewFile pages each and any remainder in the final file
PdfPageSplit.splitToNPagePDFs(new File("/path/to/input.pdf"), new File("/path/to/output-folder/"), pagePerNewFile);

//Split a PDF file into 2 files where the first page contains pages 1-pageToSplitAt inclusive, the second contains all other pages
PdfPageSplit.splitIn2(new File("/path/to/input.pdf"), new File("/path/to/output-folder/"), pageToSplitAt);

Start Your Free Trial


Customer Downloads

Select Download