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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Merge pdf files using PAD
Power Automate
Unanswered

Merge pdf files using PAD

(1) ShareShare
ReportReport
Posted on by

Hi All,

         I am splitting the giant PDF file into single page pdf files by using "Extract pdf file pages to new pdf file" action. If the filename has more than 1page it is adding sequential suffix at the end of the file names like below. 

Eg:  

test file (2).pdf

test file (3).pdf

test file (4).pdf

test file (5).pdf

test file (6).pdf

test file (7).pdf

test file (8).pdf

test file .pdf

I need to merge these files into single pdf file. I am using the below action to get the files and using merge pdf file action to merge the files. But after it got merged the pdf file page is not in the proper order. I am not sure what i am missing. Please help me out. Thanks in advance!

Th11_0-1704943457396.png

 

      

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You should use the numeric suffix on the 1st file as well, so it has a 0 or a 1 at the end. Otherwise, it will always be captured as the last item.

    Also, preferably use padded suffixes, so that if there's less than 100 files, use 01, 02, 03, <...>, 11, 12, 13, etc. If there's more than 100, pad it with leading zeros so that it has 3 digits. This way they will be sorted properly.

     

    To pad text, use the Pad text action on your suffix.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • AT88 Profile Picture
    34 on at

    Hi @Agnius , 

                         Thank you for your response. I tried to include padded suffix but it is not sorting in a correct order. It is taking a order "Extract pdf pages into new pdf file" action output and it is sorting in the same order like this.

    test file (2).pdf

    test file (3).pdf

    test file (4).pdf

    test file (5).pdf

    test file (6).pdf

    test file (7).pdf

    test file (8).pdf

    test file .pdf

     In the above example test file.pdf should be the first file and then it should go like 2,3,...8

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    It is not the first file, because it has no numeric suffix. If you opened the folder in Windows Explorer and sorted it by file name, you would notice the same - the file without a suffix would be the last one.

     

    Since you set the file name when extracting the page, you should be able to control the suffixes, so set it appropriately on the first page, too. The sorting will then work.

         -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

     

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Th11 Profile Picture
    on at

    Hi @Agnius ,

                 Thank you so much for your response. can you please post a screenshot for when extracting the pdf page, by using the pad text action to add the suffix number. so that while it merge it will sort the pages in correct order. 

    I tried from my side. But its not sorting the files properly. please help.

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Th11 

    After splitting the pdf file to multiple pdf files. Use Rename file to rename the file test file .pdf to test file (1) .pdf

     

    In that way this would work in merging the pdf files.

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard