Split PDF files in Power Automate

This article demonstrates how to separate PDF pages with the help of Power Automate (Microsoft Flow).

In this example, we will read a PDF file, split the file to get a particular page and send this page by email.

This approach can be used to extract a page or a section of a PDF document. For example, you may extract specific pages from a contract and send it for approval to the responsible person.

Our source PDF file has to be stored somewhere. Power Automate (Microsoft Flow) has a lot of connectors for different systems.

Here are just a few of them:

  • SharePoint

  • Salesforce

  • Box

  • OneDrive

  • Google Drive

  • Dropbox

  • SFTP

  • File System

You can store your files anywhere. In this example, we will use SharePoint to save our PDF file, but you can choose from other offered cloud options.

This is how our flow looks:

Split PDF flow

Setting up the Flow

The following steps will guide you through creating the flow step-by-step.

Flow trigger

You can actually pick any trigger. We used Automated Cloud Flow trigger in this example, which means the flow will be triggered automatically by a designated event. That event will be When a file is created or modified (properties only) for SharePoint.

Once you save the file or modify it in the SharePoint Library in the folder which was chosen as Library name, the flow will automatically run.

Flow trigger

Get file content

This action gets file content of the specified file from a SharePoint document library. You just specify SharePoint site URL and File identifier. We use this action to read files stored in our Library, as each document in SharePoint has ID that is unique to the document library.

You can use any other connectors to get files from your system, depending on which system you use to store files.

You may use this link to download our sample 4 pages PDF file.

Split PDF

Split PDF is an action from Plumsail Documents connector.

If this is your first time using the Plumsail Documents connector, Power Automate will request the Connection Name and API Key.

Create connection in Power Automate flow

You can type any name for the connection, for example Plumsail Documents.

Once the connection name is filled out, create an API key in your Plumsail Account, copy and paste it into the Access Key field, and then click Create.

Copying an API key from the account

Insert the PDF file content from the output of the previous action into the Document content field.

In the Start Page field, specify the first page to start the split, in the End Page field, specify the last page to split (inclusive) and enter a number of pages per partition into the Split At Page field.

In our example, we extract just one page of the document, to do that we set the fields as shown in the screenshot below:

Split PDF action

As an output of this action, we receive an array of Result files. In our case, we have just one file in the array.

Send an email

Once the result file is generated, we can send an email using the Send an email action from Office 365 Outlook connector.

Search for Send an email action from Microsoft Outlook.

Now we have to fill out email fields; specify receivers email address, subject and email body. In the advanced options section, we will give our result file a name in the Attachments name field. For the Attachment content we select to collect Dynamic content values and choose option Result files item.

This will automatically transform this action into repeating one which will be performed for each Result file. Please note that in our case, there is just one file.

Conclusion

That is all, the flow is configured. These few simple steps can help to ease the work with documents.