Create N-Up PDF Document

Create an N-Up PDF document

The Java sample uses PdfFileEditor.makeNUp to build a 2x2 layout from an existing PDF.

Steps

  1. Create a PdfFileEditor instance.
  2. Call makeNUp with the input file, output file, and the number of columns and rows.
  3. Save the generated document.
  4. If you want explicit success checking, call the boolean-return variant and handle a false result.

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.");
    }
}