web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to PDF pages using...
Power Automate
Answered

How to PDF pages using Power Automate Desktop where some invoices are over two pages rather than the usual one page.

(0) ShareShare
ReportReport
Posted on by 36

Hi,

 

I am having an issue where I built a flow where it can split PDF document invoice into single pages based on heading. The issue I am facing is how do I do it where some invoices are over two pages. 

 

So the heading will be on page 1 and the next heading is on page three. I need page 1 and 2 to be built into a single PDF document. 

 

Invoice will be coming from different people so the heading will change but the variable will be passed from the cloud flow alongside the page number. Then PAD will loop and extract the pages by text reference. 

I have attached my PAD flow with page number from Cloud Flow alongside two invoices. One invoice covering one page the other is over two pages then on the third page and forth page it covering the invoice on a single page for both three and four. 

Automate Page 1.png
Invoice One page.png
Invoice Two page.png
I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Nerfino80 

    could you please explain with some screenshot or sample pdf document of your use case so that we can try and propose appropriate solution for you. Thanks.


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀. If you'd like to appreciate me, please write a LinkedIn recommendation 🙏

  • VishnuReddy1997 Profile Picture
    2,656 Super User 2026 Season 1 on at

    Hi @Nerfino80 ,

     

    It that headings are same or any common points in PDF.

    As mentioned @Deenuji ,Please share the screenshot or PDF File.

     

    (Note:- if you got your solution you can mark as solution and gives kudos)

     

    Thanks & Regards

    Vishnu Reddy

     

     

     

  • Nerfino80 Profile Picture
    36 on at

    I have updated with screenshot thank you for looking into this

  • Nerfino80 Profile Picture
    36 on at

    Screenshot have been added thank you. 

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Nerfino80 
    I understand that the first invoice consists of one page containing the invoice information, while the second invoice spans two pages. Could you please clarify what exactly you're trying to achieve here? I'm not entirely clear on your objective. Could you elaborate a bit more?


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀. If you'd like to appreciate me, please write a LinkedIn recommendation 🙏

     
  • Nerfino80 Profile Picture
    36 on at

    What I am trying to do here is when the invoice comes into sharepoint cloud flow will pick that up and it a 25 page PDF documents with multiples invoice on one documents. I am trying to split this one documents into multiples documents based on the heading. I can get it to work when the heading and invoice on one page but across two pages is where I am struggling.  

  • IWantToKnow Profile Picture
    90 on at

    Hi @Nerfino80 ,

    When you say you were able to split the PDF into single files you meant that you did it with indicating the text to split to and from or simply split the file into single pages?

  • Nerfino80 Profile Picture
    36 on at

    Yeah each invoice got a header starting with "Short" in a one documents over three pages and I managed to split this into 3 different PDF documents based on the header "Short" so I ended up with 3 invoice document from 1 document. 

    Just Headers spaced out over two pages is where I am struggling

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Split them into individual files per page, and build a Loop condition while 1=1 (infinite loop). Then use Get files in folder to pick up your files inside this loop. If %Files.Count% = 0, use Exit loop to stop looping.

     

    Then if it's not equal to 0, continue the flow. Add a For each loop to iterate through the files. Use Extract text from PDF to get the text from the current item and store it in a variable. Continue looping until the header value changes. When it does, use Exit loop to exit the For each, and merge the files you've iterated through using Merge PDF files. Once done, delete the original files, and move the merged file elsewhere, so it is not picked up during the next iteration of the while loop. 

     

    It's an ugly workaround, but it can be made to work. We've done that for a client in the past.

  • Nerfino80 Profile Picture
    36 on at

    Thank you for sharing this Agnius, I have attempted this are you able to share an image or build of how you done it so I can try replicate it please. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 953

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 622

Last 30 days Overall leaderboard