我想用Python和pypdf库阅读PDF文件。有些 PDF 文件没有 EOF,脚本会抛出异常。
from pypdf import PdfReader reader = PdfReader(f)
如何在
f
b'%%EOF'
我没有 pdf 文件来测试它,但你不能做点什么吗:
try x if returns exception, break else, read the current page