Split PDF from Beginning
Contents
[
Hide
]
Split PDF from beginning
The Java sample extracts the first three pages from the source document.
Steps
- Create a
PdfFileEditorinstance. - Call
splitFromFirstwith the source file, number of pages to keep, and output file. - Save the new PDF document.
public static void splitPdfFromBeginning(Path inputFile, Path outputFile) {
PdfFileEditor pdfFileEditor = new PdfFileEditor();
pdfFileEditor.splitFromFirst(inputFile.toString(), 3, outputFile.toString());
}