pip install PyPDF2 import PyPDF2 pdfFileObject=open(r"F:fileName.pdf",'rb') pdfReader = PyPDF2.PdfFileReader(pdfFileObject) //Creating reader obj print(" No. Of Pages :", pdfReader.numPages)//To know no.of pages