Import/Export events

5 Dec 20251 minute to read

Import/Export events let you track and customize the full lifecycle of form field data flowing into and out of the PDF Viewer.

Use them to validate inputs, show progress UI, log audit trails, or block operations based on your business rules. Each event exposes typed event-args (ImportStartEventArgs, ImportSuccessEventArgs, ImportFailureEventArgs, ExportStartEventArgs, ExportSuccessEventArgs, ExportFailureEventArgs) describing the operation context.

Use these events to monitor and customize form field import/export operations.

Import events

  • importStart: Triggers when an import operation starts.
  • importSuccess: Triggers when form fields are successfully imported.
  • importFailed: Triggers when importing form fields fails.

Handle import events

viewer.importStart = (args: any) => {
  console.log('Import started', args);
};
viewer.importSuccess = (args: any) => {
  console.log('Import success', args);
};
viewer.importFailed = (args: any) => {
  console.error('Import failed', args);
};

Export events

  • exportStart: Triggers when an export operation starts.
  • exportSuccess: Triggers when form fields are successfully exported.
  • exportFailed: Triggers when exporting form fields fails.

Handle export events

viewer.exportStart = (args: any) => {
  console.log('Export started', args);
};
viewer.exportSuccess = (args: any) => {
  console.log('Export success', args);
};
viewer.exportFailed = (args: any) => {
  console.error('Export failed', args);
};

Notes:

  • importStart/importSuccess/importFailed cover the lifecycle of form field imports.
  • exportStart/exportSuccess/exportFailed cover the lifecycle of form field exports.

See also