Skip to content

Architecture

Papyrus is split into small layers so UI and engine can evolve independently.

Packages

PackageRole
@papyrus-sdk/typesShared contracts (DocumentEngine, Annotation, events).
@papyrus-sdk/coreStore + events (useViewerStore, papyrusEvents).
@papyrus-sdk/engine-pdfjsWeb engine adapter on top of PDF.js.
@papyrus-sdk/ui-reactWeb UI for reader, search, and navigation.
@papyrus-sdk/engine-nativeiOS/Android bridge (PDFKit, PDFium).
@papyrus-sdk/ui-react-nativeMobile UI with sheets and toolbars.

Data flow

  1. Engine loads the document and exposes page count, outline, text.
  2. UI components call engine methods and update store state.
  3. papyrusEvents emits lifecycle and annotation events for your app.

Engine agnostic

UI components never import PDF.js or native code directly. They talk to the DocumentEngine interface so you can swap engines without changing UI logic.