python parse pdf

Solutions on MaxInterview for python parse pdf by the best coders in the world

showing results for - "python parse pdf"
Juan David
15 May 2020
1import PyPDF2								 # Importing required modules
2pdfFileObj = open('example.pdf', 'rb')       # creating a pdf file object
3pdfReader = PyPDF2.PdfFileReader(pdfFileObj) # creating a pdf reader object
4print(pdfReader.numPages)                    # printing number of pages in pdf file
5pageObj = pdfReader.getPage(0)               # creating a page object
6print(pageObj.extractText())                 # extracting text from page
7pdfFileObj.close()                           # closing the pdf file object
Mila
11 Nov 2017
1pip install pdfminer.six