Skip to main content

After adding document save event listener (IDocs.Event.FileStatus), calling save api, the save event is not detected

Solution:

  1. addListener is an asynchronous interface. If you want to detect the save event, you must ensure that the save event has been successfully listened to before calling the save interface

  2. There are two ways to write it:

2.1. When initially mounting the document (ZOfficeSDK.mount), after getting zOfficeApp, immediately listen to the save event, write it like the code in the screenshot; then when executing the version conversion, call the save interface

2.2. When executing the version conversion, first listen to the save event (but must wait for the save event listener to succeed, write it as: await this.zOfficeApp.addListener....), then call the save interface