how to scale an image in advanced PDF and maintain...
# ask-stanley-ai
e
how to scale an image in advanced PDF and maintain the aspect ratio
c
AI generated answer (using internal Slack threads):
In NetSuite Advanced PDF, there isn't a direct way to scale an image and maintain the aspect ratio. The
max-width
and
auto
for height/width are not supported in BFO, which is the underlying technology for Advanced PDFs in NetSuite. However, you can use a workaround to handle different image sizes. You can write an if statement for the placement/size based on the subsidiary that's on the transaction that is being printed. This way, you can set different sizes for different logos based on the subsidiary. Here's a simplified example:
Copy code
xml
<#if subsidiary.logo == "logo1">
    <img src="${subsidiary.logo}" style="width:100px;height:100px;">
<#elseif subsidiary.logo == "logo2">
    <img src="${subsidiary.logo}" style="width:200px;height:100px;">
</#if>
In this example,
logo1
and
logo2
are placeholders for your actual logo names. You would replace
100px
and
200px
with the actual dimensions you want for each logo. Please note that this is a workaround and may not work perfectly for all scenarios. It's recommended to use logos that are of consistent pixel density for the best results. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.796736419
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.786428273
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.786200166
Please provide your feedback on this answer.