Update our code to support newer versions of PyMuPDF

This commit is contained in:
Raoul Snyman 2020-12-20 09:45:37 -07:00
parent 90343cf3bf
commit 3a83c210ba
Signed by: raoul
GPG Key ID: F55BCED79626AE9C
2 changed files with 4 additions and 3 deletions

View File

@ -1 +1 @@
2.9.1
2.9.0.dev340+90343cf3b

View File

@ -121,8 +121,9 @@ class PdfDocument(PresentationDocument):
src_size = page.bound().round()
# keep aspect ratio
scale = min(size.width() / src_size.width, size.height() / src_size.height)
m = fitz.Matrix(scale, scale)
page.getPixmap(m, alpha=False).writeImage(str(temp_dir_path / 'mainslide{:03d}.png'.format(i)))
matrix = fitz.Matrix(scale, scale)
page.getPixmap(matrix=matrix, alpha=False).writeImage(
str(temp_dir_path / 'mainslide{:03d}.png'.format(i)))
pdf.close()
created_files = sorted(temp_dir_path.glob('*'))
for image_path in created_files: