我有一个 PDF 文件,我想验证其中的链接是否正确。从某种意义上说是正确的——所有指定的 URL 都链接到网页并且没有任何损坏。我正在寻找可以轻松完成的简单实用程序或脚本?!
示例:
$ testlinks my.pdf
There are 2348 links in this pdf.
2322 links are proper.
Remaining broken links and page numbers in which it appears are logged in brokenlinks.txt
我不知道是否存在类似的东西,所以也在 stackoverflow 中进行了谷歌搜索和搜索。但是还没有发现任何有用的东西。所以希望任何人对此有任何想法!
更新:明确问题。
最佳答案
您可以使用 pdf-link-checker
pdf-link-checker is a simple tool that parses a PDF document and checks for broken hyperlinks. It does this by sending simple HTTP requests to each link found in a given document.
用 pip 安装它:
pip install pdf-link-checker
不幸的是,一个依赖项 (pdfminer
) 被破坏了。要修复它:
pip uninstall pdfminer
pip install pdfminer==20110515
关于linux - 如何验证 PDF 文件中的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8100592/