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,666 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard