michifus commited on
Commit
1c864d4
·
verified ·
1 Parent(s): 86256b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -10,7 +10,7 @@ def extract_text_from_pdf(uploaded_file):
10
  tmp_file.seek(0)
11
  with open(tmp_file.name, "rb") as f:
12
  reader = PyPDF2.PdfReader(f)
13
- num_pages = reader.numPages
14
  for page_num in range(num_pages):
15
  page = reader.getPage(page_num)
16
  text += page.extractText()
 
10
  tmp_file.seek(0)
11
  with open(tmp_file.name, "rb") as f:
12
  reader = PyPDF2.PdfReader(f)
13
+ num_pages = len(reader.pages)
14
  for page_num in range(num_pages):
15
  page = reader.getPage(page_num)
16
  text += page.extractText()