Bookmark/outline navigation issue

WebViewer Version:

Do you have an issue with a specific file(s)?
yes , with some scanned pdfs or images converted to pdfs
Can you reproduce using one of our samples or online demos?
yes
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?
yes
Is your issue related to annotations?
no
Please give a brief summary of your issue:
(Think of this as an email subject)
Bookmark/outline not navigating to correct page number

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
when I open the following pdf file in webviewer
it displays all bookmarks,
third bookmark is not navigating to the correct page 4 , it is navigating to 5th page.
this issue occurs when we set layoutmode is continuous (instance.UI.setLayoutMode(instance.UI.LayoutMode.Continuous);

if we set SIngle layout mode, it is working as expected
instance.UI.setLayoutMode(instance.UI.LayoutMode.Single);
sample test.pdf (3.0 MB)

Please provide a link to a minimal sample where the issue is reproducible:

Hi there,

Thank you for contacting WebViewer forums,

Looking at the provided PDF, it looks like clicking on the ‘second file’ outline goes to page 5 on WebViewer when it should be going to page 4.

We are adding this issue for the product team to evaluate. When this gets fixed, it will be noted in our change logs, please keep an eye out for when it will be fixed here:

Best regards,
Kevin Kim

Hi there,

Just to provide an update to this,

It looks like this was happening due to an internal rotation of the document on Page 4 to be set to 270. If you reset this to 0, it will work as expected:

Best regards,
Kevin Kim

Hello,

Wondering if there’s a fix to this. I am currently facing a similar issue, however the solution provided seems to also rotate all existing annotations messing up the document. Is there a better approach to this where the document outline navigation is fixed and we preserve the document orientation (both the pdf pages and annotations)?

Also in the Core.Document class the getPages() method doesn’t seem to be exposed in the newer WebViewer version however, it still returns the array of pages. I have tried the rotatePages() method, however that both rotates the document pages and the annotations.

Best Regards,
Aaron Lee

Hi there,

Is this still reproducible on the latest version of WebViewer?
When tested on the showcase demo(https://showcase.apryse.com/), it looks like the outlines are now navigating to the correct pages.

Best regards,
Kevin

Yes I am able to replicate this on WebViewer version 11.4.0. When I log the page rotation I get an output of 270 via this method console.log(documentViewer.getDocument().getPageRotation(1));.

But visually the page is oriented the correct way, I believe this is in part the reason why the outlines are off, but I have been unable to resolve this issue. Similar to the original problem if I set the page transition to be page by page then the outlines will navigate to the appropriate page, but if it’s set to continuous it is taking me to next page (i.e. correct page number + 1).

Also if it helps that snippet that you had included, it does help to get the outlines to navigate to the right page, but then all existing annotations are also rotated which messes up the UI. In addition, the getPages method is no longer exposed on the Core.Document class so I get typescript errors, despite the fact that it does still return the pages.

Best Regards,
Aaron Lee

Hi there,

It may be that the page is going to the correct page, but is attempting to point to the top left-corner of the actual page. If the page is rotated, then the corner it is navigating to would be on the bottom side, cause the outline to load on the next page instead.

Could you please share the input file used to reproduce the issue on 11.4?

Best regards,
Kevin

Hello Kevin,

Attached is a file that presents the rotation bug that I was referring to. If you open the pdf with a pdf editor you’ll notice that the bookmark navigation takes you to the appropriate page but when this is used in the WebViewer it will navigate incorrectly.

Document with Rotation Bug.pdf (37.0 KB)

Best Regards,
Aaron Lee

Hi there,

Thank you for the file,

I am able to reproduce the issue you mentioned, and have added this in the backlog for the product team to review.

As a workaround, if you set the page viewing mode to page-by-page, you will not experience this issue.

best regards,
Kevin