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

Notifications

Announcements

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)
  • 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>")



  • 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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 401

#2
WarrenBelz Profile Picture

WarrenBelz 334 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 325 Super User 2025 Season 2

Last 30 days Overall leaderboard