Create PDF Booklet

Create a PDF booklet

Use PdfFileEditor.makeBooklet to rearrange the pages of an existing PDF into booklet order.

Steps

  1. Create a PdfFileEditor instance.
  2. Call makeBooklet with the source PDF and output file.
  3. Save the booklet document.
  4. If you want to check the return status, use the boolean-return variant and handle a failed result.

Java example

public static void createPdfBooklet(Path inputFile, Path outputFile) {
    PdfFileEditor bookletMaker = new PdfFileEditor();
    bookletMaker.makeBooklet(inputFile.toString(), outputFile.toString());
}

public static void tryCreatePdfBooklet(Path inputFile, Path outputFile) {
    PdfFileEditor bookletMaker = new PdfFileEditor();
    if (!bookletMaker.makeBooklet(inputFile.toString(), outputFile.toString())) {
        System.out.println("Failed to create booklet.");
    }
}