Pypdf2 - 未找到EOF标记 - Python

Pypdf2 - EOF marker not found - Python

提问人:Ethan Duong 提问时间:6/2/2023 最后编辑:Bas HEthan Duong 更新时间:6/3/2023 访问量:274

问:

我尝试使用 requests.get 读取 url pdf 内容,然后使用 PyPDF2 阅读 pypdf2:版本 3.0.1 Visual Studio 代码

response = requests.get(url)

    # write to new pdf
    with open('file.pdf', 'wb') as f:
        f.write(response.content)  #succeed 

    # open and read
    txt = open('file.pdf', 'rb')

    # read file with pypdf2
    read_pdf = PyPDF2.PdfReader(txt) #error

错误:_find_eof_marker引发 PdfReadError(“找不到 EOF 标记”) PyPDF2.errors.PdfReadError:未找到EOF标记

我尝试使用 def reset_eof_of_pdf_return_stream(pdf_stream_in:list):在 python 中使用 PyPDF2 合并 pdf 文件时找不到 EOF 标记

-> 不像分配前引用的那样actual_line工作

蟒蛇 PDF EOF pyPDF

评论


答: 暂无答案