How can we rotate pdf right/left from our custom buttons

I have been trying to rotate pdf by 90 degrees (clockwise/anti-clockwise) . i have used method
“instance.setToolMode(‘rotateCounterClockwiseButton’)” to set tool to my custom button but it didn’t worked.
i have also tried method from annotManager like below
“const tool = instance.docViewer.getTool(‘rotateCounterClockwiseButton’);
instance.docViewer.setToolMode(tool);”
but this didn’t worked as well !!

so, how can i achieve this rotation of pdf functionality to my custom button?
can anyone please provide information for the same.

Thank you.

Hey there!

You can use the docViewer.rotateClockwise and docViewer.rotateCounterClockwise to rotate the document.

Hopefully this helps,
Logan