is it possible to get and locate the specify line number #1617
-
when the next time reload the same pdf, it always show the first page. when the pdf scroll, is it possible to get the exactly line number and located the line when the next time load the pdf? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In general, it's up to the browser to maintain scroll position, but given the delay between the page load and PDF load, this may not work correctly. My advice would be to use IntersectionObserver to track which page is currently displayed on the screen, keep it in sync with URL e.g. by adding #page-2 to it, and upon refresh, reading this hash to programatically move the user back to where they were. |
Beta Was this translation helpful? Give feedback.
In general, it's up to the browser to maintain scroll position, but given the delay between the page load and PDF load, this may not work correctly. My advice would be to use IntersectionObserver to track which page is currently displayed on the screen, keep it in sync with URL e.g. by adding #page-2 to it, and upon refresh, reading this hash to programatically move the user back to where they were.