Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR proposes a simple method to scroll down to a specific page or an annotation. Since Streamlit has quite a complex approach which reload at each interaction, it makes hard for any component to handle the scrolling in a customized way.
With this PR we added two additional parameters:
scroll_to_page
andscroll_to_annotation
(mutually exclusive, scrol_to_page has priority) which require an integer in input. The integer represent the positional item (page or annotation) from 1 to n.In order to know in advance number of pages and annotations, the
pdf_viewer(...)
call returns a dict as follow:Those ids are the same used in the DOM and may be used for javascript calls, however I did not manage to achieve anything with it. Nevertheless, they can be used to build a set of buttons that allow calling again the pdf_viewer with proper parameters for pages or annotations.
This PR should solve issue #24, #47, #55, and #61