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

Dataverse Image to PDF

Hi all,

 

Is it possible to include a Image from a Dataverse Image column on a PDF in the same way you can from Onedrive or SharePoint?

 

I know only the thunbnail is saved in DV but that's fine for my purposes as its a signature so low res is fine

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHarper
Helper II
Helper II

Thanks but I have the image in the app and needed to include it in a Flow that converts HTML to a PDF

 

After experimenting with different options, in the end the solution wasn't too complex:

 

Step1:  Create a variable that contains the image but when assigning the image convert it to base64 as per below:

Set(gblVariable,Substitute(JSON(myImage.Image,IncludeBinaryData),"""",""))

The substitute function strips the quotation marks from the base64

Step2:  Use the variable in your HTML ie: <img src'"gblVariable"'>

Step3: Convert the HTML to PDF using well publisized Flow methods

 

So actually once you have the image it's no more complex using Dataverse than using SharePoint or OneDrive

 

I found that you can use simple Dataverse Lookups when assigning the variable but more complex Lookups threw an unexplained error.  Best to have the image in your app (even if it is hidden) and then assign as above

View solution in original post

2 REPLIES 2
rampprakash
Super User
Super User
ChrisHarper
Helper II
Helper II

Thanks but I have the image in the app and needed to include it in a Flow that converts HTML to a PDF

 

After experimenting with different options, in the end the solution wasn't too complex:

 

Step1:  Create a variable that contains the image but when assigning the image convert it to base64 as per below:

Set(gblVariable,Substitute(JSON(myImage.Image,IncludeBinaryData),"""",""))

The substitute function strips the quotation marks from the base64

Step2:  Use the variable in your HTML ie: <img src'"gblVariable"'>

Step3: Convert the HTML to PDF using well publisized Flow methods

 

So actually once you have the image it's no more complex using Dataverse than using SharePoint or OneDrive

 

I found that you can use simple Dataverse Lookups when assigning the variable but more complex Lookups threw an unexplained error.  Best to have the image in your app (even if it is hidden) and then assign as above

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (3,860)