cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EC_1
Helper III
Helper III

Imgae Error in PDF Document

I have a flow that converts a Populated Word Document to a PDF 
and I get the items from a SQL DataBase and I also add a Signature from PowerApps to finally send it via Email
All works fine but when I get the emailed PDF the Image won't show 

Capture.PNGCapture.PNGCapture.PNG

5 REPLIES 5
WarrenBelz
Super User III
Super User III

Hi @EC_1 ,

Are you using the Word Online (Business) connector?

If so, you need to

  • Add a Picture Content Control to the Word document
  • Use Get file content using path in the Flow to get the file. If you have it in PowerApps, you may be able to send it in the Flow.
  • Add the Content of this to the Word Merge field
  • Convert it to PDF with the same connector

If you are using a Quick Parts /Library content merge, I am not aware of any way of inserting pictures.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

v-xida-msft
Community Support
Community Support

Hi @EC_1 ,

Could you please share a bit more about the "Convert Word Document to PDF" action of Word connector in your flow?

 

Based on the issue that you mentioned, it seems that there is something wrong with the image content in your created PDF File. I have made a test on my side, and don't have the issue that you mentioned.

 

Please take a try with the following flow's configuration:

10.JPG

 

11.JPG

Within the "Create file" action, set the File content field to following expression:

 

dataUriToBinary(outputs('SignatureContent'))

 

Note: To Convert the passed Signature content passed from canvas app using dataUriToBinary function. The SignatureContent action is actually a Compose action, I rename it.

 

On your side, you should also apply the dataUriToBinary function to the "Sendanemail(..." Dynamic content in your "Create file Signature" action. Please make sure the Signature image file has been created properly in your OneDrive folder.

 

Within your canvas app, you should execute the following formula:

'Flow Name'.Run(
                "PowerApps",  // first argument
                Substitute(JSON(PenInput1.Image, JSONFormat.IncludeBinaryData), """", "") // second argument for Signature image
)

 

The image displays well in my generated PDF file as below:

12.JPG

 

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-xida-msft for the extrapolation of my post.

@EC_1 , happy to continue the discussion if you need me to.

 

Im getting this error on the first "Create File" 

Unable to process template language expressions in action 'Create_file_Signayure' inputs at line '1' and column '2784': 'The template language function 'dataUriToBinary' expects its parameter to be formatted as a valid data URI. The provided value 'null' was not formatted correctly. Please see https://aka.ms/logicexpressions#dataUriToBinary for usage details.'.Capture.PNG

v-xida-msft
Community Support
Community Support

Hi @EC_1 ,

Could you please share a bit more about the "Sendanemail(..." Dynamic content in your "Create file Signature" action? Which value do you provided for this parameter?

Have you converted the PenInput image into a valid base64 encoded data using the following formula?

Substitute(JSON(PenInput1.Image, JSONFormat.IncludeBinaryData), """", "")

 

Please make sure that you have convert the  PenInput image/signature into a valid base64 encoded data, then pass the encoded data to your flow. Then within your flow, you need to use dataUriToBinary() function to convert the passed encoded base64 data into a binary data, then you could create file in your OneDrive folder based on the binary data.

On your side, please re-create a new flow based on my flow's configuration step by step, then you could create the PDF file in your OneDrive folder. Of course, if you want also to send an email along with the PDF file or the image file, you could add the "Send an email" action at the end of my flow, and pick up the file content from above actions, attach it as attachment in the email.

 

I have shared my sample flow's configuration below, please consider import it into your own Flow Environment, then re-edit it to update these connections in this sample flow using your own credential. Then re-configure it to meet your needs.

 

In addition, based on the "Sendanemail(..." Dynamic content you mentioned in your "Create file Signature" action, I think you type the "Ask in PowerApps" dynamic content within the "Send an email" action, is it right? I think there is something wrong with this operation, please try above sample flow configuration I shared, then check if it could help your scenario.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,571)