Hello
I'm trying to convert a piece of HTML to a JPG file that contains two images but no matter what I try the best I can get is one of the images showing. If I convert it to a PDF I get one image then a slither of the second image further down. If I save and view the HTML file its exactly as I want.
The HTML is as follows:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<img src="Image1" style="position:fixed; left:0px; top:0px;"/>
<img src="Image2" style="position:fixed; left:175px; top:101px; width:440px; height:306px;"/>
</body>
"Image1" and "Image2" I'm getting from OneDrive then converting to Base64 using the DataURI then I'm composing the HTML
Any ideas?
@StuPower @Dybrylla hey anybody found the solution, I also want to use some Birthday image file downloaded from some sites stored in sharepoint as background for my happy birthday message to my colleagues and want to overlay some customized text message for each and send the same as image file in email as greetings on their birthday. Birthday, name, customized message and starting position of message in image, name of image file is stored in sharepoint list. I first got content from jpeg file, text from SharePoint, composed html, convertef it to pdf, I am getting error when converting pdf to image Please share the flow you have in your use case.
No afraid not
Hi Stu,
Did you ever get this working? Im tying something similar just now and having no luck
@fransk I would be very interested in seeing the screenshot, thanks
Hi @StuPower
I have a flow that creates an HTML file from a Powerapps HMTLText control.
I then add 2 images to the top and bottom using Flow. So I first do 2 x Get File Content from Sp Doc Library and then create variables for both using dataURI.
I then do a Concat to add both images before and after the HMTLText content to create the file.
I then convert the HTML file to JPG. this creates a JPG with both images and the HTMLText.
I can't add screenshots. Will try a bit later to upload images from Chrome.
Let me know if you need more info.
Cheers
Fransk
Hi @StuPower,
I am afraid that combine multiple images into one image is impossible in Flow.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the clarification. This is now working but is creating two image files
I'm trying to create one image file with both images in it
Hi @StuPower,
1. I still input two src, just reproduce your instance.
2. the item is input manually:
3. the expression is:
dataUriToBinary(replace(replace(item(),'src=',''),'"',''))
the third parameter in the replace() function is ' ', there is a blank space in it.
The item() means the current item in the loop, for more details, please refer to this document:
Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, thanks for your help
In compose 2 are you still inputting the datauri from the "get file" as your two outputs?
What is your "Item" in the filter array I'm not getting that option?
Compose 4 is a bit hard to read with the image quality, is that-
dataUriToBinary(replace(replace(item(),'src=',"),"","))
I'm not sure where "item" is coming from
Thanks
Hi @StuPower,
You could refer to these steps to store these images in HTML into SharePoint:
1. use Split() function to split these code by using blank ' ' as the separator, then use Filter array to filter out members contains "src=".
2. use replace function to remove "src=" and double quotes
3. use dataUriToBinary() function convert the dataUri to binary.
4. Create file. Please make sure the file name not the same, or the image just has only one could create.
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional