gpt4 book ai didi

python - Pdf文件阅读器 : PdfReadError: Could not find xref table at specified location

转载 作者:行者123 更新时间:2023-12-02 21:05:07 35 4
gpt4 key购买 nike

我正在尝试通过以下方式在 python 中读取 Pdf 文件:

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

上面的行抛出错误:

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

任何帮助将不胜感激

最佳答案

已修复。事实上,没有任何问题。看来,我用来测试的 pdf 已损坏(即使当我打开它时,内容就在那里,这就是为什么我一开始就无法弄清楚)

我用另一个替换了它,它按预期工作。

关于python - Pdf文件阅读器 : PdfReadError: Could not find xref table at specified location,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34104818/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com