WebViewer Version: 11.7
Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? No
Are you using the WebViewer server? Yes
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? Maybe
Is your issue related to annotations? No
Please give a brief summary of your issue:
(Think of this as an email subject)
I would like to control the exact position of a page within the scroll view - what is the most straightforward way to do this?
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
Hi, we are building a custom UI and would like to set the position and zoom level of a PDF page exactly within the viewer/relative to the scroll view.
Imagine, for example, implementing a custom Pan tool, or for saving and restoring specific views of a document. We are only interested in doing this for page 1.
What would be the best way to do this?
I see the zoomTo method, which works for zooming but does not seem to position the page. For example, when the page is much smaller than the scroll view, it won’t move away from the top left no matter what I provide for the x & y arguments.
I also see jumpToAnnotation, but cannot see how to use this to precisely control the position of the page.
There is the actual Pan Tool of course, but I can’t see how to control it programmatically.
At the moment it seems the best approach is to create a custom Display Mode, and then I can control the page and sections directly (perhaps adding an offset to the getPageOffset function?). Is this really the best way? If I do this, do I need to do anything else to avoid breaking the rendering?
Sj