From 3d6863d63505bee4f0d966caacf08a8c6a2957d9 Mon Sep 17 00:00:00 2001 From: "Jorj X. McKie" Date: Fri, 26 Apr 2024 17:55:25 -0400 Subject: [PATCH] set DPI using mupdf attributes Addresses 3414 --- src/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/__init__.py b/src/__init__.py index 22843ca3f..923b4630b 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -732,10 +732,11 @@ def get_pixmap(self, matrix=None, dpi=None, colorspace=None, alpha=0): if not cs: cs = mupdf.fz_device_rgb() - pix = mupdf.pdf_new_pixmap_from_annot( self.this, ctm, cs, mupdf.FzSeparations(0), alpha) + pix = mupdf.pdf_new_pixmap_from_annot(self.this, ctm, cs, mupdf.FzSeparations(0), alpha) + ret = Pixmap(pix) if dpi: - pix.set_dpi(dpi, dpi) - return Pixmap( pix) + ret.set_dpi(dpi, dpi) + return ret def get_sound(self): """Retrieve sound stream."""