Skip to content

There is an issue with the image generated by the page.get_pixmap() function #2964

Closed
@1339503169

Description

@1339503169

Description of the bug

img_test.pdf
The image converted through the page.get_pixmap() function has characters that were not originally present in the PDF. The source file has characters that appear to be 'From (Shipper) 发件人', but the actual image displayed does not match the PDF. The converted image is like this, with the red box indicating the error. You can compare it with img_test. pdf for comparison

image

How to reproduce the bug

here is the code i used to generate image

'''
import fitz
document = fitz.open('./data/img_test.pdf')
page = document.load_page(0)
rotate = int(0)
zoom_x, zoom_y = 2, 2
trans = fitz.Matrix(zoom_x, zoom_y).prerotate(rotate)
pix = page.get_pixmap(matrix=trans, alpha=False)
pix.save('data/img_test.png')
'''
what should I do to get the correct picture

PyMuPDF version

1.23.7 or earlier

Operating system

Windows

Python version

3.8

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