我正在尝试使用 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 的错误吗?
最佳答案
关于java - iText7(PDF扫描): NullPointerException on redacting text,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50155741/