michifus commited on
Commit
34ed87a
·
verified ·
1 Parent(s): 1c864d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -12,20 +12,20 @@ def extract_text_from_pdf(uploaded_file):
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()
17
  return text
18
 
19
  def main():
20
  st.title("PDF Text Extractor")
21
 
22
- st.write("Yahan PDF file ko upload kare:")
23
 
24
  uploaded_file = st.file_uploader("Select PDF file", type=['pdf'])
25
 
26
  if uploaded_file is not None:
27
- st.write("PDF file ka naam:", uploaded_file.name)
28
- st.write("File ka size:", uploaded_file.size)
29
 
30
  if st.button("Extract Text"):
31
  text = extract_text_from_pdf(uploaded_file)
 
12
  reader = PyPDF2.PdfReader(f)
13
  num_pages = len(reader.pages)
14
  for page_num in range(num_pages):
15
+ page = reader.pages[page_num]
16
  text += page.extractText()
17
  return text
18
 
19
  def main():
20
  st.title("PDF Text Extractor")
21
 
22
+ st.write("Upload your pdf:")
23
 
24
  uploaded_file = st.file_uploader("Select PDF file", type=['pdf'])
25
 
26
  if uploaded_file is not None:
27
+ st.write("PDF file Upload:", uploaded_file.name)
28
+ st.write("File size:", uploaded_file.size)
29
 
30
  if st.button("Extract Text"):
31
  text = extract_text_from_pdf(uploaded_file)