Append Pages to PDF
Contents
[
Hide
]
Append pages to a PDF
The Java sample appends page 1 from a second PDF to the end of the first document.
Steps
- Create a
PdfFileEditorinstance. - Bind the main input PDF by passing its path to
append. - Provide the secondary source file list and the page range to append.
- Save the merged result to the output file.
Java example
public static void appendPagesToPdf(Path inputFile, Path sampleFile, Path outputFile) {
PdfFileEditor pdfEditor = new PdfFileEditor();
pdfEditor.append(inputFile.toString(), new String[] {sampleFile.toString()}, 1, 1, outputFile.toString());
}