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

**URL:** <https://pdfjs.community/t/how-can-we-rotate-pdf-right-left-from-our-custom-buttons/65>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [June 15, 2020, 12:41pm UTC](https://pdfjs.community/t/how-can-we-rotate-pdf-right-left-from-our-custom-buttons/65 "2020-06-15T12:41:23Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![vivek.sonawane](https://avatars.discourse-cdn.com/v4/letter/v/e95f7d/32.png) [@vivek.sonawane](https://pdfjs.community/u/vivek.sonawane)\
**Post date:** [June 15, 2020, 12:41pm UTC](https://pdfjs.community/t/how-can-we-rotate-pdf-right-left-from-our-custom-buttons/65/1 "2020-06-15T12:41:23Z")

</div>

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.

---

_[View the full topic](https://pdfjs.community/t/how-can-we-rotate-pdf-right-left-from-our-custom-buttons/65)._
