Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 pdf 库(大多数都有一些随机压缩的东西和 djvu)。其中一些 pdf 文件已损坏,应删除。
无论如何我可以在python中进行pdf完整性检查吗?
如果读取过程给您一个错误,您可以 pyPDF 读取 pdf 并声明它无效......就像这样,
from pyPdf import PdfFileReader try : mypdf = PdfFileReader(file( 'filename', 'rb')) except: print filename,' is invalid pdf'