app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# importing PyPDF2 library import PyPDF2 # open the file in binary read mode with open('bulkfile.pdf', 'rb') as file: # create a PdfReader object pdf_reader = PyPDF2.PdfReader(file) # get total number of pages total_pages = len(pdf_reader.pages) # print the total number of pages print(f"Total Pages: {total_pages}") |