web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / html to pdf image resize
Power Apps
Unanswered

html to pdf image resize

(0) ShareShare
ReportReport
Posted on by 407

Hi, I have this html attached to a button which has a flow to convert powerapp data into pdf. The conversion works fine, however the images are randomly sized. I have tried adding the height and width attrib into the img src line (highlighted in red) but with no success. Can anyone please assist

 

PDF.Run("<!DOCTYPE html>
<html>
<body>

<h1>KBX</h1>
<p>Name</p>
<div>"& (CollectGallery.Selected.Title) &"</div>
<div>"& (CollectGallery.Selected.Date) &"</div>
<img src=" & JSON(Signatures.Image, JSONFormat.IgnoreBinaryData ) & ">
<img src=" & JSON(UploadedImage1.Image, JSONFormat.IgnoreBinaryData) & ">

</body>
</html>")

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    I had a test on my side and I set, with no problem, the image dimensions with someting like this:

     

    ImageConverter.Run(
    "<!DOCTYPE html>
    <html>
    <body>

    <h1>KBX</h1>
    <p>Name</p>
    <img width='550px' height='550px' src=" & JSON(Image1.Image,JSONFormat.IncludeBinaryData) & ">

    </body>
    </html>"
    )

     

    This may be of interest but the HTML / CSS support for OneDrive HTML conversion is not 100%. I notice that it is not very reliable in conversion the use of relative dimensions.

  • Matt383 Profile Picture
    407 on at

    thankyou, the solution below works for me.  I have one more problem. When i have multiple files in my collection, it only converts the most recent file (one file only). I am converting the files directly from the gallery (see below). In the powerautomate, in createfile, i am using concat(utcNow(),'yy-MM-ddTHH:mmZ') to create unique filenames but when i hit the button to convert, it only converts one out of all the files in gallery. This is the same in onedrive. Can you please assist?

     

    'PDFconvert-2'.Run("<!DOCTYPE html>
    <html>
    <body>
    <div>"& (CollectGallery.Selected.Title) &"</div>
    <div>"& (CollectGallery.Selected.Date) &"</div>
    <br>
    <br><object data="&JSON(CollectGallery.Selected.Signature1, JSONFormat.IgnoreBinaryData)&" type='image/png' 
    <img width='550px' height='550px' src="&JSON(CollectGallery.Selected.Image1, JSONFormat.IgnoreBinaryData)&"/>
    <img width='550px' height='550px' src=" & JSON(Image1.Image,JSONFormat.IncludeBinaryData) & ">
    /object>
    </body>
    </html>")



Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard