Create N-Up PDF Document
Contents
[
Hide
]
Create an N-Up PDF document
The Java sample uses PdfFileEditor.makeNUp to build a 2x2 layout from an existing PDF.
Steps
- Create a
PdfFileEditorinstance. - Call
makeNUpwith the input file, output file, and the number of columns and rows. - Save the generated document.
- If you want explicit success checking, call the boolean-return variant and handle a
falseresult.
Java example
public static void createNupPdfDocument(Path inputFile, Path outputFile) {
PdfFileEditor nupMaker = new PdfFileEditor();
nupMaker.makeNUp(inputFile.toString(), outputFile.toString(), 2, 2);
}
public static void tryCreateNupPdfDocument(Path inputFile, Path outputFile) {
PdfFileEditor nupMaker = new PdfFileEditor();
if (!nupMaker.makeNUp(inputFile.toString(), outputFile.toString(), 2, 2)) {
System.out.println("Failed to create N-Up PDF document.");
}
}