【发布时间】:2019-04-13 19:20:00
【问题描述】:
我在使用 pypdf2 解析 PDF 文件时遇到此错误 我附上 PDF 以及错误。
I have attached the PDF to be parsed please click to view
谁能帮忙?
import PyPDF2
def convert(data):
pdfName = data
read_pdf = PyPDF2.PdfFileReader(pdfName)
page = read_pdf.getPage(0)
page_content = page.extractText()
print(page_content)
return (page_content)
错误:
PyPDF2.utils.PdfReadError: Expected object ID (8 0) does not match actual (7 0); xref table not zero-indexed.
【问题讨论】:
-
您的文件是扫描文件。您应该使用 OCR 功能从中获取文本。
-
你能给我发一份参考资料吗?
标签: python python-3.x python-2.7 pdf-parsing