# How to use undo and redo function for annotations

**URL:** <https://pdfjs.community/t/how-to-use-undo-and-redo-function-for-annotations/188>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [August 14, 2020, 12:39pm UTC](https://pdfjs.community/t/how-to-use-undo-and-redo-function-for-annotations/188 "2020-08-14T12:39:11Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![kiran.patil](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kiran.patil](https://pdfjs.community/u/kiran.patil)\
**Post date:** [August 14, 2020, 12:39pm UTC](https://pdfjs.community/t/how-to-use-undo-and-redo-function-for-annotations/188/1 "2020-08-14T12:39:11Z")

</div>

I know hotkeys are available but I want to trigger undo and redo over a button click outside the viewer.  
I have also tried trigger event for hotkeys but it doesn’t work.  
Please suggest me something to use this default feature for undo and redo of annotations.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/a9fe17b2f277ef2b8a4f711e335d3e5bfb9c28b1.png)

How to use this methods?

> ```
> this.viewerInstance.CoreControls.AnnotationHistoryManager.undo();
> 
> ```

This doesn’t work. Please let me know the actual way to invoke that method.

---

_[View the full topic](https://pdfjs.community/t/how-to-use-undo-and-redo-function-for-annotations/188)._
