确定pdf文件中的文本

时间:2019-06-24 13:39:05

标签: java pdf pdfbox

我正在分析PDF文档,以尝试确定其中的日期(见图)。 我可以使用两种Java方法:

 PDDocument doc = PDDocument.load(fil);

将PDF文件打开到PDDocument对象中,然后

 String strip = new PDFTextStripper().getText(doc);

将pdf文件中的所有文本转换为字符串。这是我想要阅读的内容(2019年6月30日)]

enter image description here

现在这是文本:

This Agreement, which is effective as of\efip2\                               (the "Effective Date")

因此,我假设\ efip2 \是图像是正确的吗?可能无法从该图像确定日期,对吗?还是不是图像而是某种包含?知道如何获得它吗?

0 个答案:

没有答案