iText7 (PdfSweep):编辑文本时出现 NullPointerException

iText7 (PdfSweep): NullPointerException on redacting text

我正在尝试使用 PDFSweep 2.0.0 (JAVA) 编辑 PDF 中的文本。我用了this example

它适用于我拥有的大多数 PDF,但在某些 PDF 文件上,代码会抛出 NullPointerException

这是代码示例:

    CompositeCleanupStrategy strategy = new CompositeCleanupStrategy();
    strategy.add(new CustomLocationExtractionStrategy("Joe"));

    PdfDocument pdf = new PdfDocument(new PdfReader(SRC), new PdfWriter(DEST));

    // sweep
    PdfAutoSweep autoSweep = new PdfAutoSweep(strategy);
    autoSweep.cleanUp(pdf);
    pdf.close();

我使用 this PDF 作为 SRC 文件。这是 itext7/pdfsweep 的错误吗?

更新您的依赖项。
我根据 pdfSweep 2.0.1-SNAPSHOT 验证了它,它运行良好。

编辑 PDF 作为证明