Skip to content

How to insert and save high resolution image to PDF #993

@coderqxr

Description

@coderqxr

Describe the bug (mandatory)

My PNG file is 600dpi, which is changed to 72 after storing as PDF.
How can I keep the original 600dpi unchanged when storing PDF?

To Reproduce (mandatory)

doc = fitz.open ()  
image = fitz.Pixmap (filename)
image.setResolution (600, 600)  
page = doc.new_ page(0, image.width , image.height )  
page.insert_ image((0, 0, image.width , image.height ), pixmap=image)  
newFileName = filename.replace ('.png', '.pdf')  
doc.save (newFileName)  
doc.close ()

Your configuration (mandatory)

  • Python 3.8

  • PyMuPDF 1.18.9

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions