扫描受保护的 pdf 文档
我目前需要查找目录中的哪些 pdf 是“受保护的文档”。 所有 pdf应该都是不安全的,并且可以通过 xpdf 进行转换,但事实并非如此。如何扫描目录中的所有 pdf 文件以了解它们是否受到保护?
I've currently run into the need to find which pdfs within a directory are "Secured Documents".
All of the pdfs should be unsecured, and convertible via xpdf, however, this is not the case. How could I scan through all the pdfs in a directory to find out whether or not they are secured?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
pypdf 支持解密 PDF。它的 PdfReader 类具有 is_encrypted 属性。
pypdf supports decrypting PDFs. Its PdfReader class has an is_encrypted attribute.
数字签名的 PDF 是另一种类型的“安全文档”。 pypdf 再次提供了一个解决方案:
该解决方案的灵感来自于 OCRmyPDF 代码。
Digitally signed PDFs are another type of ‘Secured Document’. pypdf once again provides a solution:
This solution was inspired by the OCRmyPDF code.