Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,17 +30,17 @@ def final_result(pdf_file, search_term):
|
|
30 |
st.markdown("<h3 style='text-align:center; font-size:24px;'>Search in PDF</h3>", unsafe_allow_html=True)
|
31 |
col1, col2 = st.columns(spec=[0.4,0.6])
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
30 |
st.markdown("<h3 style='text-align:center; font-size:24px;'>Search in PDF</h3>", unsafe_allow_html=True)
|
31 |
col1, col2 = st.columns(spec=[0.4,0.6])
|
32 |
|
33 |
+
st.set_page_config(layout="wide")
|
34 |
+
with col1:
|
35 |
+
input_file = st.file_uploader(label="Upload .pdf File", type='pdf')
|
36 |
+
search_term = st.text_input(label="Enter Search-term", placeholder="Search here...")
|
37 |
+
all_data = st.button("Submit")
|
38 |
+
with col2:
|
39 |
+
if all_data:
|
40 |
+
if input_file is not None and search_term.strip() != "":
|
41 |
+
result = final_result(input_file, search_term)
|
42 |
+
st.success(result)
|
43 |
+
elif input_file is None:
|
44 |
+
st.error("Please upload a PDF file.")
|
45 |
+
elif search_term.strip() == "":
|
46 |
+
st.error("Please enter a search term.")
|