In PyPDF2 pdfreader.getNumPages() gives me the total number of pages of a pdf file.
pdfreader.getNumPages()
How can I get this using pdfminer?
Using pdfminer.six you just need to import the high level function extract_pages, convert the generator into a list and take its lenght.
extract_pages
from pdfminer.high_level import extract_pages print(len(list(extract_pages(pdf_file))))