forked from openlp/openlp
Update our code to support newer versions of PyMuPDF
This commit is contained in:
parent
90343cf3bf
commit
3a83c210ba
@ -1 +1 @@
|
|||||||
2.9.1
|
2.9.0.dev340+90343cf3b
|
@ -121,8 +121,9 @@ class PdfDocument(PresentationDocument):
|
|||||||
src_size = page.bound().round()
|
src_size = page.bound().round()
|
||||||
# keep aspect ratio
|
# keep aspect ratio
|
||||||
scale = min(size.width() / src_size.width, size.height() / src_size.height)
|
scale = min(size.width() / src_size.width, size.height() / src_size.height)
|
||||||
m = fitz.Matrix(scale, scale)
|
matrix = fitz.Matrix(scale, scale)
|
||||||
page.getPixmap(m, alpha=False).writeImage(str(temp_dir_path / 'mainslide{:03d}.png'.format(i)))
|
page.getPixmap(matrix=matrix, alpha=False).writeImage(
|
||||||
|
str(temp_dir_path / 'mainslide{:03d}.png'.format(i)))
|
||||||
pdf.close()
|
pdf.close()
|
||||||
created_files = sorted(temp_dir_path.glob('*'))
|
created_files = sorted(temp_dir_path.glob('*'))
|
||||||
for image_path in created_files:
|
for image_path in created_files:
|
||||||
|
Loading…
Reference in New Issue
Block a user