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.



문의

문의가 해결되지 않았습니까? 

저희가 도와드리겠습니다. 연락해 주시면 빠르게 답변해 드리겠습니다.

문의하기
최신 정보를 받아보세요

11,000명 이상의 가입자와 함께 새로운 제품, 업데이트, 팁, 기술 솔루션 및 기회에 대한 최신 정보를 받아보시면서 iText PDF 전문가가 되어보세요.

지금 구독하기