PDF Splitter

No downloads or installation required!

Split PDFs using our free online app or learn how it works with our embedded iText 7 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 7 Sandbox

In this Sandbox you can see how the the splitting code works in iText 7, 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.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.



Contacto

¿Aún tiene preguntas? 

Estamos encantados de responder a sus preguntas. Comuníquese con nosotros y le responderemos a la brevedad.

Contáctenos
Manténgase actualizado

Únase a más de 11,000 suscriptores y conviértase en un experto en iText PDF al mantenerse al día con nuestros nuevos productos, actualizaciones, consejos, soluciones técnicas y eventos.

Suscríbase ahora