PdfFileReader:PdfReadError:在指定位置找不到外部参照表 [英] PdfFileReader: PdfReadError: Could not find xref table at specified location
本文介绍了PdfFileReader:PdfReadError:在指定位置找不到外部参照表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试通过以下方式在python中读取Pdf文件:
I am trying to read Pdf file in python through:
from PyPDF2 import PdfFileReader, PdfFileWriter
test_reader = PdfFileReader(file("test.pdf", "rb"))
以上行引发错误:
PyPDF2.utils.PdfReadError: Could not find xref table at specified location
我们将不胜感激任何帮助
Any help will be highly appreciated
推荐答案
它是固定的.实际上,没有任何问题.似乎我用来测试的pdf文件已损坏(即使我打开它时,内容也在那里,这就是为什么我一开始无法弄清楚的原因)
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.
这篇关于PdfFileReader:PdfReadError:在指定位置找不到外部参照表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文