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