Any way to maintain an images aspect ratio in an a...
# advancedpdf
e
Any way to maintain an images aspect ratio in an advanced pdf? Some of the logos I plan to use are Square, some are rectangular. Wanting to just set height to 100px and let the width handle itself.... possible?
d
try *moreover, have you tried the "dpi" attribute of <img>? Keep image aspect ratio in Advanced Template : Netsuite
also maybe wrapping the img in a container that's forced to 100px height?
dpi attribute won't work, it just scales all images the same...
wasn't able to do this in any way, except by having a reference to the logo's native width/height on the record and using that in my pdf i.e.:
Copy code
<img src="${imageurl}" height="100px" width="${(100/height)*width}px"/>
e
Ahh, that was the same way I was getting it to work. Was hoping there was an easier/cleaner way. I appreciate you checking those other options
👍 1