Remove PDF Bates Numbering in Java

Remove Bates numbering from all pages of a PDF in Java.

Delete Bates numbering

Use this approach when existing Bates numbering artifacts should be removed from the document.

  1. Open the source PDF Document.
  2. Call the page collection helper that deletes Bates numbering.
  3. Save the cleaned output file.
public static void deleteBatesNumbering(Path inputFile, Path outputFile) {
    try (Document document = new Document(inputFile.toString())) {
        PageCollectionExtensions.deleteBatesNumbering(document.getPages());
        document.save(outputFile.toString());
    }
}