Disabling automatic synchronization in Nutrient Web SDK
When using Instant, you might need to disable automatic synchronization with Document Engine. To achieve this, configure the PSPDFKit.Configuration
object before passing it to PSPDFKit.load()
, as shown in the following example:
PSPDFKit.load({ // ...other options instant: { clientsPresenceEnabled: false, listenToServerChangesEnabled: false }, autoSaveMode: PSPDFKit.AutoSaveMode.DISABLED });
Detailed implementation
Use the following code snippet to disable automatic synchronization, prevent Instant from tracking client presence, and disable automatic local saving:
return PSPDFKit.load({ instant: { // Don't pull changes from Document Engine automatically. listenToServerChangesEnabled: false, // Disable clients presence tracking. `instance.connectedClients` // method and `instant.connectedClients.change` event won't be available. clientsPresenceEnabled: false }, // Disable automatic saving of local changes. autoSaveMode: PSPDFKit.AutoSaveMode.DISABLED, ... })
return PSPDFKit.load({ instant: { // Don't pull changes from Document Engine automatically. listenToServerChangesEnabled: false, // Disable clients presence tracking. `instance.connectedClients` // method and `instant.connectedClients.change` event won't be available. clientsPresenceEnabled: false }, // Disable automatic saving of local changes. autoSaveMode: PSPDFKit.AutoSaveMode.DISABLED, ... })
Manually syncing changes
Once you disable automatic synchronization, use PSPDFKit.Instance#save
to sync changes manually whenever needed.
For more information, refer to our guides on automatic and manual syncing and listening for client updates.