cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jean_9681
Helper II
Helper II

Converting HTML to Image.JPG is not working

I have my HTML in a compose action and i am able to convert it to an HTML file, this HTML file shows the image


However, while trying to convert the HTML file to JPG the image does not show instead the there is white(blank) image with a red x mark on top left corner.

 

What am i missing here ?  - This is what i have in my flow

 

convertfile.png

 

Any suggestions

Thank you,

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Jean_9681,

 

In that case you can use a get file content using path action instead.

 

Also update the expression to this:

concat('data:', body('Get_file_content_using_path')?['$content-type'] ,';base64,',body('Get_file_content_using_path')?['$content'])

 

getfilecontent_usingpath.png

View solution in original post

4 REPLIES 4
Expiscornovus
Super User
Super User

Hi @Jean_9681,

 

What is in your compose action? Is the img src pointing to a hyperlink or are you pointing to a base64 value?

 

If you are pointing to a public image you could try the approach below.

In this example I used the screenshot from your opening post btw 😁

 

concat('data:', body('HTTP')?['$content-type'] ,';base64,',body('HTTP')?['$content'])

 

getfilecontent_base64.png

@Expiscornovus  thanks for the taking the time to help me with this, In my case I am getting an image from SharePoint library..  
My Compose action has <img src pointing to "Link to Item">

Since HTTP action is a PREMIUM  I am not allowed to use this action 😞
Will Send an HTTP request to SharePoint work - since i am getting the image from SharePoint


Expiscornovus
Super User
Super User

Hi @Jean_9681,

 

In that case you can use a get file content using path action instead.

 

Also update the expression to this:

concat('data:', body('Get_file_content_using_path')?['$content-type'] ,';base64,',body('Get_file_content_using_path')?['$content'])

 

getfilecontent_usingpath.png

@Expiscornovus  Thank you so much, this worked 👍

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,345)