HelpBot Assistant

How can I help you?

PDF Form Import and Export Events in React

25 Feb 20262 minutes to read

Import and export events enable tracking and customization of the full life cycle of form data imported into or exported from the PDF Viewer.

Use events to:

  • Validate inputs before processing.
  • Show progress indicators.
  • Log audit trails.
  • Block operations based on business rules.

Each event provides detailed context through typed event arguments such as ImportStartEventArgs, ImportSuccessEventArgs, ImportFailureEventArgs, ExportStartEventArgs, ExportSuccessEventArgs, and ExportFailureEventArgs.

Import Events

Example: Handle Import Events

// ...viewer initialization...
viewer.importStart = (args) => {
  console.log('Import started', args);
  // e.g. show spinner, validate inputs
};
viewer.importSuccess = (args) => {
  console.log('Import success', args);
  // e.g. hide spinner, show toast
};
viewer.importFailed = (args) => {
  console.error('Import failed', args);
  // e.g. show error dialog
};

Export Events

Example: Handle Export Events

// ...viewer initialization...
viewer.exportStart = (args) => {
  console.log('Export started', args);
  // e.g. disable export UI
};
viewer.exportSuccess = (args) => {
  console.log('Export success', args);
  // e.g. enable UI, provide download link
};
viewer.exportFailed = (args) => {
  console.error('Export failed', args);
  // e.g. re-enable UI, notify user
};

Key Notes

  • importStart, importSuccess, importFailed cover the full import life cycle.
  • exportStart, exportSuccess, exportFailed cover the full export life cycle.

See also