Showing results for 
Search instead for 
Did you mean: 
Responsive Resident
Responsive Resident

Convert Pdf to image

Hello all,


I have a "Add Picture" control that i would like for my users to add an image file. I am saving these images into a SharePoint list using the Json function to convert the images to base64 that way i can pull the images into a gallery and view them. Like so,  Set(Image,JSON(AttachmentImage.Image,JSONFormat.IncludeBinaryData)).


Now this works fine, but i noticed when a user of mine adds a pdf file, i cannot see the file in my gallery, also the start of the base64 for a pdf shows as: "data:application/pdf;base64..." as oppose to normal images "data:image/png;base64 ..."


How can i convert any pdf uploaded into an image, or is it easier to just convert anything uploaded to a pdf ? and how will i be able to show the pdfs in the gallery.


Thank you

Resident Rockstar
Resident Rockstar

You can convert images to PDF in Power Automate with either the Encodian connector or the OneDrive For Business connector.

To display, you could have an Image control and a PDF Viewer control and toggle their visibility like this

//For PDF Viewer
"pdf" in AddMediaButton.FileName

//For image control
Not("pdf" in AddMediaButton.FileName)

If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Responsive Resident
Responsive Resident

how about the other way around, pdf to image

Resident Rockstar
Resident Rockstar

I don't know of any way off the top of my head to convert a PDF to an image. You could ask the Power Automate community here

Helpful resources

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,010)