Skip to content

MuPDF error: format error: negative code in 1d faxd #4224

Closed
@uwohlfeil

Description

@uwohlfeil

Description of the bug

Dear PyMuPdf team,

we have found a PDF file that generates an error when I try to convert its pages to an image.
I have also tested the javascript variant of this library (mupdf.js) which produces the same error.

I test this document with other tools like Ghostscript, ImageMagik or pdftoppm and also PDF viewers like pdf.js.
All of them were able to render this PDF without any errors.

Can you please investigate this problem?

I attached the document here:
Testdokument-Scan-bw-OCR.pdf

How to reproduce the bug

import pymupdf

doc=pymupdf.open("Testdokument-Scan-bw-OCR.pdf")

for p in doc.pages():
    pix = p.get_pixmap(dpi=150)
    pix.save("t-%s.png" % p.number)
    pix = None
doc.close()

PyMuPDF version

1.25.1

Operating system

Linux

Python version

3.12

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions