How can I read pdf in python? [duplicate]

You can USE PyPDF2 package

# install PyPDF2
pip install PyPDF2

Once you have it installed:

# importing all the required modules
import PyPDF2

# creating a pdf reader object
reader = PyPDF2.PdfReader('example.pdf')

# print the number of pages in pdf file

# print the text of the first page

Follow the documentation.

Leave a Comment