diff --git a/streamlit_app.py b/streamlit_app.py index be9cc9e..d5f250c 100644 --- a/streamlit_app.py +++ b/streamlit_app.py @@ -137,6 +137,9 @@ def init_grobid(): init_grobid() +def my_custom_annotation_handler(annotation): + st.success(f"Annotation {annotation} clicked.") + def get_file_hash(fname): hash_md5 = blake2b() with open(fname, "rb") as f: @@ -222,7 +225,8 @@ def get_file_hash(fname): annotation_outline_size=annotation_thickness, pages_to_render=st.session_state['page_selection'], render_text=enable_text, - resolution_boost=resolution_boost + resolution_boost=resolution_boost, + on_annotation_click=my_custom_annotation_handler ) else: pdf_viewer( @@ -233,5 +237,6 @@ def get_file_hash(fname): annotation_outline_size=annotation_thickness, pages_to_render=st.session_state['page_selection'], render_text=enable_text, - resolution_boost=resolution_boost + resolution_boost=resolution_boost, + on_annotation_click=my_custom_annotation_handler )