[Fixed] Python 3.10 "Decimal" issue

This commit is contained in:
Salvador E. Tropea 2022-09-23 12:38:49 -03:00
parent 7ed371cd50
commit 518d533887
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ def create_pdf_from_pages(input_files, output_fn, forced_width=None):
pdf_reader = PyPDF2.PdfFileReader(file)
page_obj = pdf_reader.getPage(0)
if forced_width is not None:
width = page_obj.mediaBox.getWidth()*25.4/72
width = float(page_obj.mediaBox.getWidth())*25.4/72
scale = forced_width/width
logger.debugl(1, 'PDF scale {} ({} -> {})'.format(scale, width, forced_width))
page_obj.scaleBy(scale)