Skip to main content

Notifications

Community site session details

Community site session details

Session Id : wPhi4PvM+fdqbYykmqZeoe
Power Automate - Power Automate Desktop
Suggested answer

Split PDF into multiple PDF

Like (1) ShareShare
ReportReport
Posted on 29 Nov 2022 15:13:57 by 333

I have created a flow to split the single pdf into multiple single page pdf file.

 

I have a scenario like, the files usually has 50+ pages, each page is an invoice, COA, Waybills, etc., and each invoice, COA, Waybills, etc. should be split into 1 single PDF.

However, sometimes, an invoice, COAs runs to 2nd or 3rd page. So I cannot use a fixed number to do the split. In case like this, on the 2nd and 3rd page, there’s a keyword of “Page of”.

 

How could I configure so the bot knows where to do the split correctly?

  • Suggested answer
    Esbastian Profile Picture
    24 on 30 Jan 2025 at 20:14:44
    Split PDF into multiple PDF
    Hi VDI,
     
    I would do the the following:
     
    1) Create 1 variables, start_page
    1) Create a Loop with the number of pages in the PDF
    2) Within the Loop Use the Extract Text from PDF activity. But Enable the Page to Extract by Range and use the loop index to iterate over every single Page
    3) Create an if statement that using a keyword that you know is going to be present in the first page of every invoice.
        - Within the if statement add that page index to a List.
     
    Now you have a List with the first page of every invoice. Getting the last page of the invoice will be as easy as reducing the following item in the list by 1.
     
    Now you can use that list to iterate over every element with the "Extract PDF file pages to new PDF file" action.
     
    Hope this helps! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,695 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started