Membuat PDF booklet

Membuat PDF booklet

Gunakan PdfFileEditor.makeBooklet untuk menyusun ulang halaman PDF yang ada menjadi urutan buku pamflet.

Langkah

  1. Buat instans PdfFileEditor.
  2. Panggil makeBooklet dengan PDF sumber dan file output.
  3. Simpan dokumen booklet.
  4. Jika perlu memeriksa status hasil operasi, gunakan varian yang mengembalikan boolean dan tangani hasil yang gagal.

Contoh Java

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