如何验证 PDF 或 Excel 文件未损坏
我有点进退两难,我们即将雇用一名实习生,他的第一份工作将是检查大约 200 个 PDF、40 个 Adobe Photoshop 文件、大约 300 个 Word 文档和 120 个 Excel 文件,以验证它们是否未损坏以及是否已损坏。对它们有任何保护(密码)。
我不想让这个孩子感到无聊,所以我正在考虑将其自动化。我想知道如何验证 PDF 文件是否有效以及它们是否有密码,而无需在 Acrobat 中打开它们。
是否有我可以查找的 BOM,或者 PDF 是否足够可解析以使用 iTextSharp 之类的东西?至于Office文件,我希望Office Interop可以查看该文件并通过对象模型告诉我?我不确定 Photoshop 是否可行,所以他必须手动完成。
这将用 C# 或 Delphi.NET(我们的语言)编写为一个小型 WinForms 应用程序。
有什么想法吗?
I have a slight dilema, we're about to hire an intern and his first job will be to go through roughly 200 PDFs, 40 Adobe Photoshop files, around 300 word documents and 120 excel files to verify that they are not corrupted and whether they have any protection on them (password).
I don't want to bore the kid, so I was thinking of automating it. I'm wondering what I can do to verify whether the PDF files are valid and whether they have any password without having to open them in Acrobat.
Is there a BOM I can look for or is PDF parsable enough to use something like iTextSharp? As for the Office files, I'm hoping Office Interop can look at the file and tell me via the object model? Photoshop I'm not sure is even possible, so he'll have to do that manually.
This will be written as a small WinForms application in C# or Delphi.NET (our language here).
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以自动将它们打印出来或转换为图像,然后查看哪些不起作用
You could automate printing them out or converting to image and see which ones do not work