Skip to main content
Community site session details

Community site session details

Session Id :

Know where to split a PDF with multiple documents in it

JoeF-MSFT Profile Picture Posted by JoeF-MSFT

JoeFMSFT_0-1645313379206.png


This flow takes a PDF that has multiple documents in it – for example, multiple invoices in a single PDF – and uses a delimiter word you provide to know where the PDF should be split or processed. It uses AI Builder text recognition (OCR) to read all the text from the PDF to then obtain the page ranges for the different documents in the PDF.

 

You can customize this flow to use a connector that will do the actual splitting of the PDF like Adobe PDF Services, Encodian, Plumsail among others. Or you can directly specify the page range in supported AI Builder actions like Invoice Processing and Form Processing. To use this flow:

 

  1. You will need to have an AI Builder license to use this flow. Don’t have one? You can start a free trial at: https://aka.ms/tryaibuilder?utm_source=powerautomate-cookbook&utm_medium=post&utm_campaign=aib-split-pdf

  2. Import the attached .zip file in this message into your Power Automate environment. 

  3. After you upload the flow, make sure you go to the ‘Initialize document delimiter variable’ action and define which text delimits the beginning of a new document. For examples, in this PDF example ‘Adatum multiple invoices.pdf’ we use the word ‘Invoice’ as the text that delimits the start of a new invoice.

    JoeFMSFT_0-1645312441906.png

     

    JoeFMSFT_1-1645312498087.png

     

  4. When running the flow, the actions ‘Page range for split’ and ‘Last page range for split’ will return the page ranges for each document within the PDF. You can add here any action to split of process the PDF by page range.

    JoeFMSFT_2-1645312582979.png

    JoeFMSFT_3-1645312607844.png

     

Don't hesitate to ask questions in the comments section below! 💬

 

Categories:

AI Builder

Comments

  • Sagardpilli Profile Picture Sagardpilli 4
    Posted at
    Know where to split a PDF with multiple documents in it

    @JoeF-MSFT 

    Thanks for your solution which is working in my case.

    Any ideas how to create files with dynamic names from the same process if we trying to split a huge file with multiple invoices?

  • wqpoekqpokeq Profile Picture wqpoekqpokeq 15
    Posted at
    Know where to split a PDF with multiple documents in it

    Hi @JoeF-MSFT , 
    I have two questions:

    1. Is there any action/function that splits the pdfs that is free? We are currently testing whether or not we can use Power Automate to automate some of our processes and we don't want to commit to buying a product yet.

    2. In what step of your flow can we put for instance a function that creates a new excel row that specifies the page ranges for every document? Because if i put it at the end I only get the last page range of the whole document and not every other one before that.

  • theresia Profile Picture theresia 10
    Posted at
    Know where to split a PDF with multiple documents in it

    hi can u make it dekstoo flow version? i have to use the dekstop flow version bcs my file is more than 50 mb (limit file size cloudflow) thanks

  • ABoyNamedSue Profile Picture ABoyNamedSue 46
    Posted at
    Know where to split a PDF with multiple documents in it

    Hi @JoeF-MSFT 

    Found your post and this is exactly what I need. Trying to figure out where to insert your flow into mine to make it work. Here is my post with the working flow: 

    https://powerusers.microsoft.com/t5/General-Power-Automate/Extracting-Data-from-structured-documents/m-p/2317280 

  • JoeF-MSFT Profile Picture JoeF-MSFT
    Posted at
    Know where to split a PDF with multiple documents in it

    Hi @RookAils, thanks for the question. You can use the Create file action in your flow, from the Google Drive connector. 

     

    JoeFMSFT_1-1692458142425.png

     

  • RookAils Profile Picture RookAils 29
    Posted at
    Know where to split a PDF with multiple documents in it

    Hi @JoeF-MSFT , how do I save the splitted PDFs into GoogleDrive ?

  • minhvo Profile Picture minhvo 24
    Posted at
    Know where to split a PDF with multiple documents in it

    Thanks for sharing the workflow.

    It works for me.

  • JoeF-MSFT Profile Picture JoeF-MSFT
    Posted at
    Know where to split a PDF with multiple documents in it

    Hi @rishabhgupta - this cookbook from @plarrue can help for your scenario: Renaming files in OneDrive after extracting a fiel... - Power Platform Community (microsoft.com)

  • rishabhgupta Profile Picture rishabhgupta
    Posted at
    Know where to split a PDF with multiple documents in it

    How can we rename the file as per the user name and save the file to other location instead of dataverse? Above flow works fine but i want to send the splitted files to onedrive instead of Dataverse. And also want to save the file name as ..

     

    User ID   abc.com

    ...........

    User ID xuz.com...

     

    So it will extract the User ID and save the pdf named as abc.com or xuz.com

     

  • JoeF-MSFT Profile Picture JoeF-MSFT
    Posted at
    Know where to split a PDF with multiple documents in it

    Hi @JayJayRiv - thanks for the question. You will need to click on + Create new and provide your credentials. Hope this helps! 🙂

     

    JoeFMSFT_0-1677355376766.png