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);