Feb-03-2023, 08:51 PM
(This post was last modified: Feb-03-2023, 10:03 PM by standenman.)
This code will not display any text and but wll print the number of pages, 31, in the pdf file. I can change the number of the page up and still no text printed.
Any suggestions?
Any suggestions?
# importing required modules import PyPDF2 # creating a pdf file object pdfFileObj = open('Documents/VisitDate.pdf', 'rb') # creating a pdf reader object pdfReader = PyPDF2.PdfFileReader(pdfFileObj) # printing number of pages in pdf file print(pdfReader.numPages) # creating a page object pageObj = pdfReader.getPage(13) # extracting text from page print(pageObj.extractText()) # closing the pdf file object