WebViewer Version: 11.12.0 (Migrated from 10.10.1)
Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? Yes (Any
multi-page PDF with placed annotations)
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No (Vanilla JS / jQuery)
Is your issue related to annotations? Yes (specifically jumpToAnnotation API)
Please give a brief summary of your issue: jumpToAnnotation resets scroll position to Page 1 / Start of PDF before navigating to destination page in WebViewer 11
Please describe your issue and provide steps to reproduce it:
We recently migrated our document viewer from WebViewer 10.10.1 to 11.12.0. Following this migration, we have noticed a major change in how annotationManager.jumpToAnnotation behaves when navigating between annotations on different pages.
Steps to Reproduce:
- Load a multi-page PDF with annotations scattered across multiple pages
(e.g., Page 3 and Page 5).
- Scroll to Page 5, and trigger a programmatic jump back to an annotation on
Page 3 using:
annotationManager.jumpToAnnotation(targetAnnotation, { isSmoothScroll:
true });
Expected Behavior (as in WebViewer 10.10.1):
The viewer scrolls smoothly and directly from its current position (Page 5) to
the target annotation on Page 3.
Actual Behavior (in WebViewer 11.12.0):
- The viewport instantly resets / jumps back to the very first page (top of
the document).
- It then scrolls from the first page down to the destination
annotation on Page 3.
Our concerns:
- Is this layout reset to the start of the PDF expected behavior in WebViewer 11 when executing jumpToAnnotation?
- Are there any configuration flags or layout options we can set during initialization to force jumpToAnnotation to transition directly from its current scroll viewport position rather than resetting to page 1 first?
Please provide a link to a minimal sample where the issue is reproducible: A simple setup listening to a sidebar button click that calls jumpToAnnotation on any off-screen annotation on a multi-page document reproduces this behavior.
Hello Rohan.
Thank you for contacting WebViewer Forums.
We are currently not aware of an issue where the starting position would reset back to the first page when using the jumpToAnnotation() API. It should scroll from the current viewport position to the target annotation.
To investigate, could you please provide the following:
- Video showcasing this issue
- Minimal sample project to reproduce the issue
Regards,
Luke
Hello Luke,
Thanks for responding. While I cannot share much, Iām adding a video showcasing the issue.
I am on the 41st page and jump to a signature box thats on the same page. The pdf scrolls from page 1 to 41 again despite being on the same page.
Code snippet:
$('body').on('click', '.jumpToAnnot', function () {
var targetId = $(this).attr('id').replaceAll('view-', '');
var selectedAnnot = $widget._getAnnotationById(targetId);
if (selectedAnnot) {
annotationManager.jumpToAnnotation(selectedAnnot, {isSmoothScroll: true});
}
});
Thanks,
Rohan
Hello Rohan,
Thank you for your reply.
At this time, our team is unable to reproduce the issue. We would require a minimal sample project showcasing the issue to investigate further.
That being said, a migration from v10 to v11 changed the way WebViewer is initialized from Iframe to WebComponent. I would recommend checking if there are any CSS or code that may need update or interfere with the Viewer container. I would also check if switching back to Iframe fixes the issue for you. More information can be found here: Migrating to V11 of WebViewer | Apryse documentation
Regards,
Luke
1 Like
Hello Luke,
I forgot to mention we are using iframe legacy ui . We have found that providing the zoom to jumpToAnnotation seems to fix the issue.
annotationManager.jumpToAnnotation(selectedAnnot, {
isSmoothScroll: 'true',
zoom: currentZoom
});
By passing zoom: currentZoom, WebViewer smoothly scrolls directly to the signature box from its current scroll position without resetting to the top first.
Could you confirm if this is considered a valid, supported workaround from your side, or if there are any unintended side effects we should watch out for?
Thanks,
Rohan
1 Like
Hello Rohan,
Thank you for your reply.
Passing in the zoom option can help re-render the Viewer before jumping to the annotation which I believe is fixing the scroll container element from being fetched incorrectly and defaulting to the first page. This workaround is suitable and will not have any impact as this option is part of the API however feel free to reach out if you are experiencing any further issues.
Regards,
Luke
2 Likes