Soumen commited on
Commit
7b01ac0
·
1 Parent(s): 8c11fa3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -125,10 +125,10 @@ def main():
125
  if st.session_state["photo"]=="done" or message:
126
  #text=""
127
  if uploaded_photo.type=='application/pdf':
128
- file = uploaded_photo.read() # Read the data
129
- image_result = open(uploaded_photo.name, 'wb') # creates a writable image and later we can write the decoded result
130
- image_result.write(file)
131
- text = read_pdf(image_result)
132
  #text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
133
  st.success(text)
134
  elif uploaded_photo.type != "application/image":
 
125
  if st.session_state["photo"]=="done" or message:
126
  #text=""
127
  if uploaded_photo.type=='application/pdf':
128
+ #file = uploaded_photo.read() # Read the data
129
+ #image_result = open(uploaded_photo.name, 'wb') # creates a writable image and later we can write the decoded result
130
+ #image_result.write(file)
131
+ text = read_pdf_with_pdfplumber(uploaded_photo)
132
  #text = pytesseract.image_to_string(img, lang="ben") if st.checkbox("Mark to see Bangla Image's Text") else pytesseract.image_to_string(img)
133
  st.success(text)
134
  elif uploaded_photo.type != "application/image":