mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 14:42:33 -05:00
fix pdf image result
This commit is contained in:
1 parent
f78cf8cc6e
commit
1690337699
1 file changed
+7
-5
@@ -735,14 +735,16 @@ module Submissions
|
||||
|
||||
page = pdf.pages.add
|
||||
|
||||
scale = [A4_SIZE.first / attachment.metadata['width'].to_f,
|
||||
A4_SIZE.last / attachment.metadata['height'].to_f].min
|
||||
image = attachment.preview_images.first
|
||||
|
||||
page.box.width = attachment.metadata['width'] * scale
|
||||
page.box.height = attachment.metadata['height'] * scale
|
||||
scale = [A4_SIZE.first / image.metadata['width'].to_f,
|
||||
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(
|
||||
StringIO.new(attachment.preview_images.first.download),
|
||||
StringIO.new(image.download),
|
||||
at: [0, 0],
|
||||
width: page.box.width,
|
||||
height: page.box.height
|
||||
|
||||
Reference in new issue
Block a user