How to Convert a PDF to a PNG Image Array in Power Automate

Cloudmersive
5 min readJan 24, 2025

--

PNG is a popular lightweight image format primarily used for its transparency features. In Power Automate, we can convert any PDF to a series of transparent PNG files with just a few clicks.

What does converting PDF content to PNG do?

If we have a text-based PDF document like the below example:

Converting our PDF to a PNG can give us a transparent iteration of that text (meaning we can apply it to any suitable background):

The above text is a little difficult to see in the above screenshot, but that’s no big deal — we can now load this picture in another application (like PowerPoint, for example) and place it on a light background for contrast.

Our transparent text image is now infinitely reusable, and because we’re dealing with a raster file (rather than plain text), we never have to worry about reformatting or adjusting the text body again.

Converting PDF to PNG in Power Automate

In this article, we’ll walk through a quick example of how to convert PDF documents to PNG format in Power Automate.

We’ll build a manually triggered flow that uses the Cloudmersive Document Conversion connector to handle our PDF to PNG conversion.

Create a manually triggered, Instant cloud flow

Configure the manual trigger with a custom file input

Once we have our instant cloud flow set up, we’ll configure our trigger action to accept one input PDF document from our file system.

Find the Cloudmersive Document Conversion connector

Next, we’ll add a new action beneath our trigger & search for Cloudmersive connectors. We’ll locate the Cloudmersive Document Conversion connector with the green logo.

We’ll click “See more” to view the actions list, and we’ll then search for an action titled Convert PDF to PNG Image Array.

Create a Cloudmersive API connection

Before we configure our request parameters, we’ll first sign into the connector by naming our connection & supplying a free Cloudmersive API key. To get a free API key (the same type of key I’m using in this walkthrough), visit the Cloudmersive website and create a free account. This will give you a limit of 800 API calls/month with zero additional commitments.

Configure the PDF to PNG Image Array conversion request

To configure our request, we’ll pass dynamic content from our trigger step to each of the above request parameters. This dynamic content will appear exactly as we named it (i.e., “Select a PDF Document” in my example).

Download the PNG Array

The PDF to PNG conversion action we just configured speeds up the process of returning PNG files to our flow by sending each file back as a temporary URL.

Using another Cloudmersive Document Conversion connector action called Finish editing document, and download result from document editing, we can download PNG content from each temporary URL in our flow.

Once we enter the URL value from our Convert PDF to PNG response into the Finish editing ReqConfig/InputFileUrl field, Power Automate will automatically place our Finish editing action in a For each control (this downloads each PNG sequentially).

Create each PNG file in SharePoint with a Create file action

To wrap up our flow, we’ll now add a Create file action within the For each control. We’ll dynamically name each new PNG file with a combination of response content & manual trigger content (this way, we’ll end up with clearly labeled files like “page 1 example.png”, “page 2 example.png”, etc).

Note that in the above example, the slice() function is used to remove the “.pdf” string from the end of the input PDF name. This avoids saving a double-extension file (e.g., “page 1 example.pdf.png”).

Run a test

We’ll now save and test our flow, which will involve selecting an example PDF document from our system.

When our flow finishes running, we’ll find our new PNG files in our SharePoint folder.

We can now use rasterized text on a transparent background in a wide variety of different situations!

Conclusion

In this article, we discussed the benefits of converting PDF documents to PNG, and we subsequently learned how to easily convert PDF files to PNG arrays using the Cloudmersive Document Conversion connector in Power Automate.

Be sure to follow this blog for more tips & demos in Power Automate (and a wide range of common programming languages!)

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet