إضافة ختم مطاطي

إضافة ختم مطاطي

  1. اربط ملف PDF المصدر بـ واجهة PdfContentEditor.
  2. استدعِ createRubberStamp(...) مع رقم الصفحة، المستطيل، العنوان، المحتويات، واللون.
  3. احفظ مستند PDF المحدث.
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();
    }
}