PDF Splitter

No downloads or installation required!

Split PDFs using our free online app or learn how it works with our embedded iText 9 Sandbox.


Use the free online PDF Splitter app

Click the box below to upload a PDF, or drag and drop a PDF into the box.

You can then choose the page where you want to split the PDF.

Click Split PDF and then download the results.

Or play in the iText Sandbox

In this Sandbox you can see how the the splitting code works in iText 9, and experiment with changing the code yourself.

Click Upload File and make sure the file name of the PDF you upload matches the name you specify in private static final String ORIG. Then click Execute to run your code. To remove an uploaded file, click the x displayed next to the file name.

You can click the switch at the top of the Sandbox to change between the embedded Java and C# compiler.

import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfReader; import com.itextpdf.kernel.pdf.PdfWriter; import com.itextpdf.kernel.utils.PageRange; import com.itextpdf.kernel.utils.PdfSplitter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; public class PDFSplitter { private static final String ORIG = "/uploads/split.pdf"; private static final String OUTPUT_FOLDER = "/myfiles/"; public static void main(String args[]) throws IOException { final int maxPageCount = 2; // create a new PDF per 2 pages from the original file PdfDocument pdfDocument = new PdfDocument(new PdfReader(new File(ORIG))); PdfSplitter pdfSplitter = new PdfSplitter(pdfDocument) { int partNumber = 1; @Override protected PdfWriter getNextPdfWriter(PageRange documentPageRange) { try { return new PdfWriter(OUTPUT_FOLDER + "splitDocument_" + partNumber++ + ".pdf"); } catch (final FileNotFoundException ignored) { throw new RuntimeException(); } } }; pdfSplitter.splitByPageCount(maxPageCount, (pdfDoc, pageRange) -> pdfDoc.close()); pdfDocument.close(); } }
Disclaimer:

iText does not analyze the content of your uploaded or processed files. Users bear sole responsibility for the usage and content of their own files. All uploaded and processed files are deleted from our servers after users leave the page, or automatically after a period of 3 hours.



Contact

Still have questions? 

We're happy to answer your questions. Reach out to us and we'll get back to you shortly.

Contact us
Stay updated

Join 11,000+ subscribers and become an iText PDF expert by staying up to date with our new products, updates, tips, technical solutions and happenings.

Subscribe Now