ラバースタンプの追加

ラバースタンプの追加

  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();
    }
}