在 pdf 中爬行
我正在开发一个工具,可以搜索用户在给定网站上输入的关键字。我的问题是,它仅在 html/网页上搜索关键字,而不在网站上找到的 PDF/MS-Word 文件上搜索关键字。
谁能给我推荐一些 api/工具或者提供可以从给定的在线 PDF/MS-Word/Text 文件中搜索文本的代码?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 JVM 上运行的任何内容中进行开发,您可能最好使用 POI 进行 MS Office 文档解析和 PDFBox 、 JPedal 或 PDF Clown 用于解析 .pdf。
对于一般索引,您不会错过 lucene 和 nutch。
Developing in anything that runs on the JVM, you would probably do best using POI for MS Office document parsing and PDFBox, JPedal or PDF Clown for parsing .pdfs.
For general indexing, you wont miss with lucene and nutch.
您可以对 Word 文件使用 Antiword 。
pdftotext
可用于 pdf 文件。这两个命令都可以通过 apt 获得:
sudo apt-get install xpdf-utils antiword
You could probably use Antiword for word files.
pdftotext
can be used for pdf-files.Both commands available through apt:
sudo apt-get install xpdf-utils antiword