Skip to content

Concepts

Rivoli PDF is built around a small set of ideas. Once you understand them, the rest of the API tends to fall into place. These pages explain how the library thinks: the document model you build against, how that model becomes pages, how styling cascades, and how the document round-trips through JSON.

You do not need to read these in order, but if you are new to the library this is a reasonable path:

  • The document model: the DOM: DocumentSection → block → inline. The tree you build, and the objects you build it from.
  • The layout engine: how the document tree is measured, arranged, and paginated into pages.
  • The styling cascade: Style, StyleSheet, inheritance, and how formatting resolves.
  • The JSON document model: canonical and compact serialization, stable node identity, and Git-friendly diffs.
  • Change tracking: opt-in events for collaborative editing, undo/redo, and audit logging.
  • How PDF works: a short primer on the PDF object model, just enough to demystify error messages.