列出印章
Contents
[
Hide
]
列出页面上的印章
- 将源 PDF 绑定到
PdfContentEditor对象。 - 调用
getStamps(pageNumber)检索目标页面上的印章。 - 检查结果
StampInfo[]集合。
public static void listStamps(Path inputFile) {
PdfContentEditor editor = new PdfContentEditor();
try {
editor.bindPdf(inputFile.toString());
StampInfo[] stamps = editor.getStamps(1);
System.out.println("Stamps on page 1: " + stamps.length);
} finally {
editor.close();
}
}