Document Context
Shared rendering and layout state used across the entire document pipeline. Holds the active backend, cached sub-backends (text, shape, image, page), page metrics, section nodes, and the layout cursor.
-
class DocraftDocumentContext
Context Facade: Orchestrates document rendering and layout services.
This is the primary entry point for the document rendering pipeline. It composes four services:
RenderingService: backend + capability caching
LayoutService: cursor + page metrics
TypographyService: font management
NavigationService: document structure (header/body/footer) + page nav
Responsibilities:
Wiring and lifetime management of services
Renderer setup and delegation
Direct access to four service bundles
Public Functions
-
DocraftDocumentContext()
Constructs a context with a default PDF backend.
Constructs a context with backend providers factory.
-
~DocraftDocumentContext()
Destructor.
-
services::RenderingService &edit_rendering()
Returns the rendering service (backend + capability caching).
-
const services::RenderingService &rendering() const
-
services::LayoutService &edit_layout()
Returns the layout service (cursor + page metrics).
-
const services::LayoutService &layout() const
-
services::TypographyService &edit_typography()
Returns the typography service (font management).
-
const services::TypographyService &typography() const
Returns the navigation service (sections + page navigation).
Sets the renderer responsible for translating document nodes to backend calls.
- Parameters:
renderer – Renderer instance.