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 / need to get the page(s...
Power Automate
Unanswered

need to get the page(s) count from a pdf file using PAD

(0) ShareShare
ReportReport
Posted on by 5
Hello all,

i am working on a project where it requires to fetch the pages count from a pdf file.

so, could you please help me on this?
I have the same question (0)
  • VishnuReddy1997 Profile Picture
    2,656 Super User 2026 Season 1 on at
     
    You can try two methods to get this.
     
    Method 1 : If you go templates in PAD you have template ready to get pages count from PDF a shown in below image.
     
    Methods 2: You use this python script to get pdf pages count. Save the Code as .py file and invoke using Run Powershell script action as shown in below.
     
     
    Python Script :
    import fitz  # PyMuPDF
    import sys
    
    def count_pages(pdf_path):
        pdf_document = fitz.open(pdf_path)
        num_pages = pdf_document.page_count
        return num_pages
    
    if __name__ == "__main__":
        if len(sys.argv) != 2:
            print("Usage: python count_pages_pymupdf.py <pdf_path>")
            sys.exit(1)
    
        pdf_path = sys.argv[1]
        num_pages = count_pages(pdf_path)
        print(f"{num_pages}")
     
     
    Regards,
    Vishnu Reddy
  • Peter PP Profile Picture
    6 on at
    Sorry, replied in error

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 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard