fix pdf image result

pull/493/head
Pete Matsyburka 5 months ago
parent f78cf8cc6e
commit 1690337699

@ -735,14 +735,16 @@ module Submissions
page = pdf.pages.add page = pdf.pages.add
scale = [A4_SIZE.first / attachment.metadata['width'].to_f, image = attachment.preview_images.first
A4_SIZE.last / attachment.metadata['height'].to_f].min
page.box.width = attachment.metadata['width'] * scale scale = [A4_SIZE.first / image.metadata['width'].to_f,
page.box.height = attachment.metadata['height'] * scale A4_SIZE.last / image.metadata['height'].to_f].min
page.box.width = image.metadata['width'] * scale
page.box.height = image.metadata['height'] * scale
page.canvas.image( page.canvas.image(
StringIO.new(attachment.preview_images.first.download), StringIO.new(image.download),
at: [0, 0], at: [0, 0],
width: page.box.width, width: page.box.width,
height: page.box.height height: page.box.height

Loading…
Cancel
Save