Simplest way to set the exact position/offset of a page within the scroll view?

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


To control the exact position and zoom level of a PDF page in Apryse’s WebViewer, particularly for implementing custom features like a Pan tool or saving specific views, you can use a combination of methods. The key is to manipulate the scroll position and zoom level of the document viewer to achieve your desired view.

Some things you can try:

  • Use the instance.docViewer.getScrollViewElement() method to access the scrollable element of the document viewer. You can then set the scroll position using JavaScript.

  • Utilize the instance.setZoomLevel() method to set the zoom level of the viewer.

  • For precise positioning, calculate the scroll position based on the current zoom level and the desired page coordinates.

  • If you want to save and restore views, store the current scroll position and zoom level, then apply them when needed.



Here are some resources that might help you:


Hopefully, this helps you solve your problem while you wait for a human to get back to you.

1 Like