Rotate of page is rotating wrong page

Product: PDFTron WebViewer

Product Version:8.10.0-20221130

Please give a brief summary of your issue:

On changing the zoom size to 50% in edit mode.

When 2nd page is rotated twice the focus shifts to 1st page and the rotation affects the 1st page. On rotating once again the focus again changes to 2nd page.


Please describe your issue and provide steps to reproduce it:

  1. open a document in document viewer
  2. put the document into edit mode
  3. change zoom option to 50% the second page
    5.rotate the page
    6.rotate the page a second time
    7.notice that focus changes to the first page

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

1 Like

Hi Vineet,

Thanks for reporting the issue. We were able to reproduce and we have added the issue as a bug into our backlog to be worked on. We will get back to you again when we finish the bug fixing.



Can i get ETA on resolution.

Best Regards,


We are unfortunately not able to provide an accurate ETA before it is triaged internally. Roughly speaking, based on our current backlog status it would take us a few months to get there.


I don’t know if it’s bug-related, but with this code:

// Add rotation button to main toolbar
webViewerInstance.UI.setHeaderItems((header) => {
        type: 'actionButton',
        dataElement: 'rotateCustomButton',
        img: 'icon-header-page-manipulation-page-rotation-clockwise-fill',
        onClick: async () => {
            const pageNum = documentViewer.getCurrentPage();
            const originalPageRotation = documentViewer.getDocument().getPageRotation(pageNum);
            const availableRotations = webViewerInstance.Core.PageRotation;
            let rotation;

            switch (originalPageRotation) {
                case 0: rotation = availableRotations.E_90; break;
                case 90: rotation = availableRotations.E_180; break;
                case 180: rotation = availableRotations.E_270; break;
                case 270: rotation = availableRotations.E_0; break;
                default: rotation = availableRotations.E_0; break;

            await documentViewer.getDocument().rotatePages([pageNum], rotation);
            documentViewer.trigger(customEvent.ROTATE_PAGE, { pageNum, rotation });

When clicking the button, the viewer, at first click behaves well, but on second click it rotates twice.
Maybe it’s on my side, maybe you can reproduce, but it looks like a viewer behavior issue like