如何用pdf中的空填充空空间?使用PDFBox
我正在使用Java PDFBox来读取PDF,
这是一个非常长的PDF,其中有40多页,我需要在每个页面上提取100个以上的元素,使用坐标手动进行操作将使我永远。
有没有办法将PDF页面文本排成行,每个空白空间都充满了一个空值?
使用代码:
PDFTextStripper stripper = new PDFTextStripper();
stripper.setSortByPosition(true);
stripper.setStartPage(30);
stripper.setEndPage(30);
LOG.info("page 30 \n{}", stripper.getText(document));
我明白了:
016 1 300
030 17 994 41 629 15 712
042 676 676
问题是我无法确定是否只有一个或两个值!
I am using Java PDFBOX to read a pdf
It is a very long pdf with more than 40 pages, and I need to extract more than 100 elements on each page, doing it manually using coordinates would take me forever.
Is there a way to get the pdf page text in rows with each empty space filled with some null value?
When I parse this table for example:
using the code:
PDFTextStripper stripper = new PDFTextStripper();
stripper.setSortByPosition(true);
stripper.setStartPage(30);
stripper.setEndPage(30);
LOG.info("page 30 \n{}", stripper.getText(document));
I get this:
016 1 300
030 17 994 41 629 15 712
042 676 676
The problem is that I can't tell if there are just one or two values which are which !!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论