Menambahkan cap karet

Menambahkan cap karet

  1. Ikat PDF sumber ke fasad PdfContentEditor.
  2. Panggil createRubberStamp(...) dengan nomor halaman, persegi panjang, judul, isi, dan warna.
  3. Simpan dokumen PDF yang diperbarui.
public static void addRubberStamp(Path inputFile, Path outputFile) {
    PdfContentEditor editor = new PdfContentEditor();
    try {
        editor.bindPdf(inputFile.toString());
        editor.createRubberStamp(1, new Rectangle(120, 450, 180, 60), "Approved", "Approved by reviewer", Color.GREEN);
        editor.save(outputFile.toString());
    } finally {
        editor.close();
    }
}