I am new to Python, and I am trying to create a script that will list all the PDF’s in a directory and the number of pages in each of the files.
I have used the recommended code from this thread: Using Python to pull the number of pages in all the pdf documents in a directory
However, there were two problems:
DeprecationError: PdfFileReader is deprecated and was removed in PyPDF2 3.0.0. Use PdfReader instead.
DeprecationError: reader.getNumPages is deprecated and was removed in PyPDF2 3.0.0. Use len(reader.pages) instead.
I used the recommendations but get the error:
AttributeError: 'PdfReader' object has no attribute 'len'
How can I fix this?
Thanks