Update app.py
Browse files
app.py
CHANGED
@@ -58,11 +58,11 @@ def translate(userinput, target_lang, source_lang=None):
|
|
58 |
|
59 |
def get_pdf_text(pdf : Union[str, bytes, bytearray]) -> str:
|
60 |
reader = PdfReader(pdf)
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
return text
|
67 |
|
68 |
|
|
|
58 |
|
59 |
def get_pdf_text(pdf : Union[str, bytes, bytearray]) -> str:
|
60 |
reader = PdfReader(pdf)
|
61 |
+
pdf_text = ''
|
62 |
+
for page in (reader.pages):
|
63 |
+
text = page.extract_text()
|
64 |
+
if text:
|
65 |
+
pdf_text += text
|
66 |
return text
|
67 |
|
68 |
|