Count PDF Pages with Python
Level: Beginner
Your task for today is to create a PDF page counter script in Python that scans a folder for PDF files and counts the pages in each file. This project introduces you to working with PDF files using PyPDF2.
Project Task
Create a PDF page counter that:
Scans a specified folder for all PDF files
Counts the number of pages in each PDF file
Displays the filename and page count for each PDF
Shows the total page count at the end
Uses the PyPDF2 library for PDF processing
This project gives you hands-on practice with file system operations, PDF manipulation, data aggregation, and external libraries — essential skills for document automation and batch processing.
Sample Data
You can use these PDF documents for this project. Place them in a folder and have the Python script count their pages.
Expected Output
The program should output something like below when executed:
Join the Python & AI Builders Skool Community
Got questions to ask the author about this project? Join our Python & AI Builders community for weekly Python & AI videos and discussions:
💻 Launch This Project in Colab
Open the interactive Google Colab notebook for today’s project — with full instructions, hints, and solutions.
Click the button below to start coding — no setup needed:
Keep reading with a 7-day free trial
Subscribe to Daily Python Projects to keep reading this post and get 7 days of free access to the full post archives.



