Skip to content

doc.xref_stream(xref).decode().splitlines() does NOT split the line #3419

@ragebear00

Description

@ragebear00

Description of the bug

after upgrade to PyMuPDF 1.24.2, the following code will print one paragraph for each page, not split lines.

Downgrade to PyMuPDF 1.22.5, doc.xref_stream(xref).decode().splitlines() works again, and it will print "line", not "paragraph" for one page.

How to reproduce the bug

    for page in doc:
        page.clean_contents()  # cleanup page painting commands
        xref = page.get_contents()[0]  # get xref of the resulting source
        cont0 = doc.xref_stream(xref).decode("utf8").splitlines()  # and read it as lines of strings
  
        for line in cont0:
            print(line)

PyMuPDF version

1.24.2

Operating system

Windows

Python version

3.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    not a bugnot a bug / user error / unable to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions