How to Split a PDF with Microsoft Power Automate?

By Vishnu Subramoniam | Automation

How to Split a PDF with Microsoft Power Automate?

As the world is moving towards a paperless documentation system, the use of digital documents is seeing exponential growth. People from all demographics are getting aware of the existence and importance of using digital docs. Parallel there is a rise in the automation of online documents.

Automation Apps like Power Automate, Zapier, etc are seeing greeted usage and relevance in the digital world. For those who use a digital document often, it’s important to understand and explore such possibilities in document technology. With a highly equipped document management suite and a flexible automation app, you can save valuable time for more important tasks.

PDF4me is a document management platform that has introduced powerful connectors in Power Automate - previously Microsoft Flow - to enable users to achieve the best results in document automation. Let’s see how this is possible by trying to Split a PDF with Microsoft Power Automate.

Split PDFs with PDF4me Connectors

Building a Flow in Power Automate requires a minimum of two properly configured components. A Trigger and an Action. A Trigger is what marks the beginning of a Flow. It can be anything as small as an HTTP request to a document being created in your Cloud storage like Dropbox or Onedrive. Here let’s simply traverse the process of automating the splitting of a PDF document from Onedrive.

Split PDF using Power Automate Design

The Action to Split the PDF is performed by the PDF4me Split PDF connector. Here, we choose to split the document at every single page and create a PDF out of each page. The connector provides various modes of splitting the document.

Split After Page - The action lets you split a PDF after a specific page.

Recurring Split After Page - The pages are split here recurringly at a specific interval mentioned by the user. E.g, if you provide a value of 2 for the Split Action Value, the action will divide the PDF after every second page. This will create smaller PDFs with 2 pages each from the source PDF.

Let’s look at a scenario where a user would like to create a PDF out of each page of his PDF file.

Output of split PDF after single page

Constructing the Split PDF Flow

To begin with the Flow construction, we need to define the Trigger.

  • For this, we make use of an HTTP request trigger for One Drive Web to initiate the data transfer process. Whenever a new PDF is discovered by the Trigger, it sends an HTTP request. You can also make use of other possible triggers that suits your purpose, say, a Scheduler to trigger an action whenever a file is created in the storage.
Get file metadata using path
  • Now we need to access the document. An Onedrive action is set-up to retrieve the file metadata, for which we configure the folder where our document will be available in Onedrive.

  • Now that we know have all the metadata of the file, we need to get the file contents to start processing it. Let’s create a second Onedrive action here to get the contents of the file.

Read the file data from OneDrive to send to the PDF4me
  • Now that we have set-up all the pre-requisites to start processing the file, it’s time to put the PDF4me connector into action. The Slit PDF connector takes charge from here. We have to now pass all the data we have about our PDF to the PDF4me Split Connector. We use the Recurring Split After Page option to construct our sample Flow. Remember to provide the Split Action Value, in our scenario 1 (one).
Split after each single page and a new PDF document is returned
  • The chain of processes till now will deliver a list of output files. The output of the previous Split PDF step can now be used to do additional manipulations. In this case, we want the generated documents to be stored back in the same folder in OneDrive from where the event has been triggered.
Expression the correct folder path

We can also make use of an Expression to create an advanced step for a particular action. E.g, the expression below is to set folder path where the split files need to be stored.

replace(triggerBody()?['filePath'],body('Get_file_metadata_using_path')?['Name'],'')

Split action action value

We need to select the output from the previous step, specify the Folder Path, File Name, and File Content also in the final Action.

Save time with PDF4me - Power Automate Templates

Microsoft Power Automate also enables us to create templates out of the Flows we have created. This will help us structure newer Flows based on the template or reuse them for creating similar Flows. This will save us a lot of time than having to re-create Flows from scratch.

PDF4me itself puts a lot of time into understanding the user requirements and creates basic templates that are most commonly used. This makes life easy for avid Power Automate users to create document work Flows with some simple clicks in a matter of minutes.

Try out the Split PDF at Each Page template from PDF4me.

Let’s save the most priceless asset of our lives, Time, for the most important tasks.

Related Blog Posts