cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sonam1996sahoo
Frequent Visitor

Conversion of image file to pdf is not supported on Power Automate

Hi,

I am having trouble converting an image file to PDF using Power Automate. It's showing me an error 'Conversion of an image file to pdf is not supported. Here I am attaching the flow with the error message. Convert Image to PDF failed.png

 

Conversion of image file tyo pdf is not supported.pngIf someone can help me figure out what's wrong, I would really appreciate it.

Thanks in Advance.

5 REPLIES 5
Dahlqvist84
Frequent Visitor

Hi,

 

If you first convert to html and pdf it will work. See attached screenshot.

 

Dahlqvist84_0-1643492121971.png

Expression in Create HTML:
outputs('Get_file_content')?['body']['$content-type']

outputs('Get_file_content')?['body']['$content']

 
sonam1996sahoo
Frequent Visitor

Hi @Dahlqvist84 

 

I tried this one, but still, I am getting errors on the converted file. 

Convert Image to PDF using flowConvert Image to PDF using flow

 

Dahlqvist84
Frequent Visitor

Can you show me what you got in compose and create file?

 

The filename must be "filename.html" on the first create file before the convert file action. So you convert from html to PDF.

 

Dahlqvist84_0-1643654892443.png

 

sonam1996sahoo
Frequent Visitor

I did not get that dynamic content that you have used in the Create HTML. So I used here File content from the Get file content. Also, I already used the File name using the '.html' extension.

Create image to PDF using Power Automate.png

Dahlqvist84
Frequent Visitor

Try to paste this in compose action and see if it works for you.

 

<img src="data:@{outputs('Get_file_content')?['body']['$content-type']};base64,@{outputs('Get_file_content')?['body']['$content']}" style="max-width: 550px;">

 

 

Else you need to type in the expression to the compose action.

 

First type this in compose:

<img src="data:;base64," style="max-width: 550px;">

 

Then mark after "data:" and before ";base64"

Click the expression icon

Dahlqvist84_0-1643707311946.png

Type in below text to the expression.

outputs('Get_file_content')?['body']['$content-type']

 

Do the same after "base64," and type the expression.

outputs('Get_file_content')?['body']['$content']

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,298)