Skip to content

Demo + Events

The demo is built from examples/web and embedded here. The default PDF is the local TraceMonkey sample in examples/web/assets. To switch between PDF/EPUB/TXT, edit examples/web/App.tsx and update the engine/source constants.

Events

Listen to SDK events and forward them to the docs console.

ts
papyrusEvents.on(PapyrusEventType.DOCUMENT_LOADED, (payload) => {
  console.log('Document loaded', payload);
});

papyrusEvents.on(PapyrusEventType.TEXT_SELECTED, (payload) => {
  console.log('Text selected', payload);
});
Event Log
Waiting--:--:--
Trigger a demo action or select text in the viewer.