Events

Events are the heartbeat of interactive PDFs. Every time a user clicks a button, types in a field, or interacts with your document, an event fires. JavaScript code attached to these events brings your PDFs to life.

The event object appears automatically when an event fires; you don't create it or access it through this. It's simply there in your event handler code, containing information about what triggered the event.

Quick reference

Event types:

  • Fields: Focus, Blur, Keystroke (typing or selection), Validate, Format, Calculate

  • Document: Open, WillSave, DidSave, WillPrint, DidPrint

  • Mouse: Up, Down, Enter, Exit

  • Page: Open, Close

Key patterns:

  • Cancel event: event.rc = false

  • Dropdown change: Keystroke with willCommit = true

  • Character input: Keystroke with willCommit = false

  • Stamp document access: event.source.source

Moving forward

Events transform static PDFs into dynamic documents. By understanding event flow and choosing the right event for each task, you can create sophisticated forms that respond intelligently to user actions. The detailed property reference in event provides complete documentation for all event properties.

Resources

Revu 21

Revu JavaScript

JavaScript

Learn about JavaScript events—the heartbeat of interactive PDFs.