Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_pixmap cannot get full image #3399

Closed
tangent2018 opened this issue Apr 18, 2024 · 1 comment
Closed

get_pixmap cannot get full image #3399

tangent2018 opened this issue Apr 18, 2024 · 1 comment
Labels
not a bug not a bug / user error / unable to reproduce

Comments

@tangent2018
Copy link

Description of the bug

Hello, Jorj

I want to convert pdf to jpg, first page can be converted but the second cannot.

How to reproduce the bug

pdf_path = Path(r'sample.pdf')
doc = fitz.open(str(pdf_path))
for i, page in enumerate(doc):
    trans = fitz.Matrix(2, 2).prerotate(0)
    pm = page.get_pixmap(matrix=trans, alpha=False)
    jpg_path = f'{pdf_path.stem}_{i}.jpg'
    pm.save(jpg_path)

sample.pdf
result_0
result_1

PyMuPDF version

1.23.x or earlier

Operating system

Windows

Python version

3.8

@JorjMcKie
Copy link
Collaborator

You must have received a lot of error messages when making the pixmap of page 2: "MuPDF error: syntax error: unknown colorspace: R9".
The color space is not supported, respectively its definition is syntactically wrong.

@JorjMcKie JorjMcKie added the not a bug not a bug / user error / unable to reproduce label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug not a bug / user error / unable to reproduce
Projects
None yet
Development

No branches or pull requests

2 participants