Update app.py
Browse files
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 =
|
16 |
text += page.extractText()
|
17 |
return text
|
18 |
|
19 |
def main():
|
20 |
st.title("PDF Text Extractor")
|
21 |
|
22 |
-
st.write("
|
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
|
28 |
-
st.write("File
|
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)
|