Link
Skip to main content

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.pdf outputFolder 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("inputFile.pdf"), new File("outputFolder"));

//Split the file into multiple new files with pagePerNewFile pages each and any remainder in the final file
PdfPageSplit.splitToNPagePDFs(new File("inputFile.pdf"), new File("outputFolder"), 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("inputFile.pdf"), new File("outputFolder"), pageToSplitAt);

Get started with JPedal in 3 steps

  1. Fill in the form to download the trial jar →
  2. Copy the code snippets as instructed on the next page
  3. Build your solution using our docs

Learn more about JPedal

Start Your Free Trial


Customer Downloads

Select Download