添加橡皮图章
Contents
[
Hide
]
添加橡皮图章
- 将源 PDF 绑定到
PdfContentEditor对象。 - 调用
createRubberStamp(...)包含页码、矩形、标题、内容和颜色。 - 保存更新后的 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();
}
}