Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions pdfreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
#matter = files.read()
#print (matter)

pdfFileObj = open(path, 'rb')
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
a=pdfReader.numPages
pdfFileObj = open(path, 'rb') # Open the pdf file
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
a=pdfReader.numPages # Get the number of pages
print(a)
x=1
c=1

#Reads the PDF

# Reads the PDF
def read(page):

# Get the content of the page
page_content= pdfReader.getPage(int(page))
b = page_content.extractText()
b = page_content.extractText() # Convert the content in readable form
print(b)
engine = pyttsx3.init()
rate = engine.getProperty('rate')
Expand All @@ -31,11 +30,11 @@ def read(page):
engine.runAndWait()
engine.stop()

# The main code
# The beginning logic
while(x):
page = input("Enter the page number to read :")
page = input("Enter the page number to read :") # Read the input from the console

read(page)
read(page)
c=int(input("Do you want to continue? (1)Yess (2)No"))
if(c==2):
x=0
Expand Down