PdfFileReader: PdfReadError: Could not find xref table at specified location

空扰寡人 提交于 2019-12-10 20:13:00

问题


I am trying to read Pdf file in python through:

from PyPDF2 import PdfFileReader, PdfFileWriter
test_reader = PdfFileReader(file("test.pdf", "rb"))

Above Line throws error:

PyPDF2.utils.PdfReadError: Could not find xref table at specified location

Any help will be highly appreciated


回答1:


It's fixed. Actually, there wasn't any problem. Seems, the pdf I was using to test was corrupted one (even though when I opened it, the content was there, which is why I couldn't figure out at first place)

I replaced it with another one and it worked as expected.



来源:https://stackoverflow.com/questions/34104818/pdffilereader-pdfreaderror-could-not-find-xref-table-at-specified-location

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!