Link
Skip to main content

Split Pages From PDF

v2025.05

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.manipulator.PdfManipulator --splitInHalf inputFile outputFolder pageToSplitAt
java -cp jpedal.jar org.jpedal.manipulator.PdfManipulator --splitIntoPages inputFile outputFolder numberOfPages

The pageToSplitAt variable defines which page of the file to split at. The first half of the file contains the specified page. The numberOfPages variable defines how many pages will be in each output file. The last file will have that many or less pages depending on how many are remaining.

Split PDF files in Java

// Split a PDF file into two files where the first page contains pages 1-pageToSplitAt inclusive, the second contains all other pages
PdfManipulator.splitInHalf(new File("inputFile.pdf"), new File("outputFolder"), pageToSplitAt);

// Split all pages into separate PDF files, all output has the same file name with the page numbers appended
PdfManipulator.splitIntoPages(new File("inputFile.pdf"), new File("outputFolder"), numberOfPages);

Why JPedal?

  • Actively developed commercial library with full support and no third party dependencies.
  • Process PDF files up to 3x faster than alternative Java PDF libraries.
  • Simple licensing options and source code access for OEM users.

Learn more about JPedal

Start Your Free Trial


Customer Downloads

Select Download