List Stamps

List stamps on a page

  1. Bind the source PDF to the PdfContentEditor facade.
  2. Call getStamps(pageNumber) to retrieve the stamps on the target page.
  3. Inspect the resulting StampInfo[] collection.
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();
    }
}