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 store our source PDF file in SharePoint, but you can get data from other sources.
This is how our flow looks:
The following steps will guide you through creating the flow step-by-step.
You can actually pick any trigger. For example, you can start Flow on file creation in a SharePoint document library. We use Manually trigger a flow trigger here to simplify the Flow.
This action gets file content of the specified file from a SharePoint document library. You just specify SharePoint site URL and path to your file. We use this action to read our sample PDF file.
You can use any other connector to get files from your system.
You may use this link to download our sample 10 pages PDF file.
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.
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.
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:
As an output of this action, we receive an array of Result files. In our case, we have just one file in the array.
Once the result file is generated, we send an email using Send email action from Office 365 Outlook connector. We fill in the email fields; in the Attachments section, we add a name for the new PDF file and choose ResultFileContents - Item as an output from previous steps. This will automatically transform this action into repeating one which will be performed for each Result file. In our case, there is just one file.
That is all, the flow is configured. These few simple steps can help to ease the work with documents.