How to listen for any document edits?


Is there in event that triggers when the user makes any change to a document? I’m using


right now but of course that only covers changes to annotations. I’m trying to have my app autosave every 30 seconds but only if the user has made a change.

1 Like

Hello Kenedy,

There is no single event that triggers when any change is made to the document, but you can use a combination of events in this case.

const { documentViewer, annotationManager, ContentEdit} = instance.Core;

annotationManager.addEventListener('annotationChanged', callback);
documentViewer.addEventListener('pageNumberUpdated', callback);
ContentEdit.addEventListener('textContentUpdated', callback);

We have many other events listed in our API guide below:

Thank you.

Best Regards,
Darian Chen

1 Like

Ok, thanks for your response. annotationChanged and textContentUpdated should cover everything I need.

1 Like