I have a flow that converts my HTML text to a PDF in SharePoint. I need to attach my company logo to the PDF however, the image always appears as an x (see image).
My HTML code is
"<center> Confidential Information - For Internal Use Only - Do Not Redistribute </center>
<h3> Risk Details </h3>
<img src='https://extranet.companyname.ca/?r=489&k=41e75be41d' alt='Logo'>" & ...
Please help me insert an image into my pdf! Thanks!
The first thing I noticed is that you don't have a file extension on your image link. Without that extension the PDF won't recognize it as an image file. Ist it a .JPG, .PNG or what?
I have the files downloaded to my computer as PNG and I just tried using the link I grabbed from sharepoint (https://mycompanyonline.sharepoint.com/sites/BusinessIntelligenceandAnalytics/Shared%20Documents/Pow...) however, I have the same error! Note: I changed the URL for privacy reasons.
Take a look at the following Blog post from John Liu. Evidently to embed it in the PDF you need to convert the image to a binary represnation.
Hi @Anonymous ,
Do you want to embed the image into a PDF file?
Do you pass the Html text from a canvas app to a flow (MS Flow), and then create a PDF file?
I agree with @Pstork1 's thought almost. If you want to embed an image into a PDF file, you need to convert the image content into a dataUrl string firstly.
On your side, you could consier store your image file within a cloud storage, e.g. OneDrive folder, SP Library, etc. Then get the file content of the image file stored in your cloud storage, and concatenate it with the HTML text string passed from your app.
After that, create a HTML file based on the concatenated string, and then convert the HTML file into a PDF file using the "Convert file using path" action or "Convert file" action of OneDrive connector, then check if the issue is solved.
Hi @v-xida-msft ,
Yes, I do want to embed an image into my PDF file and yes, my flow takes the html from a canvas app to create a file in sharepoint (following Shane Young's video).
How/where do I convert the image content into a dataUrl string?
Also, following your other instructions do I need to change anything once the image is a dataURI string?
Thank you so much for your help, I really appreciate it!
Hi @Anonymous ,
Within your flow, you should configure it as below:
within the "Initialize variable" action, you should set the Name field to dataUriString, specify Type to String, set the Value field to following formula:
More details about using expresson in flow actions, please check the following blog:
Please consider take a try with above solution, then check if the issue is solved.
Check out new user group experience and if you are a leader please create your group
Check out how to claim yours today!
We are excited to announce that Demo Extravaganza for 2021 has started!
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks