Expand description
XFA layout output to PDF content stream overlay generation.
Converts LayoutDom (from xfa-layout-engine) into PDF content stream operators that can be overlaid on existing PDF pages.
XFA Spec 3.3 §2.6 (p55-56) — Transformations: XFA uses top-left origin
(y grows downward), PDF uses bottom-left origin (y grows upward).
The CoordinateMapper handles this transformation.
XFA Spec 3.3 §2.7 — Z-Order: objects are rendered in document order. Later objects appear on top of earlier objects (painter’s algorithm).
Structs§
- Coordinate
Mapper - Maps XFA coordinates (top-left origin) to PDF coordinates (bottom-left origin).
- Font
Metrics Data - Resolved font metrics for a typeface, used for accurate text measurement.
- Image
Info - Image data collected during rendering for XObject embedding.
- Page
Overlay - Overlay result for a single page, including content stream and images.
- Render
Tree - The full intermediate render tree for a document.
- XfaRender
Config - Configuration for PDF overlay rendering.
Enums§
- Render
Node - A node in the intermediate render representation.
Functions§
- generate_
all_ overlays - Generate PDF content stream overlays for all pages in a layout.
- generate_
field_ values_ overlays - Generate overlays containing only field value text — no backgrounds, borders, captions, draws, or images. Used by the preserve_static path when widgets lack AP streams.
- generate_
page_ overlay - Generate a PDF content stream overlay for a single page.
- layout_
dom_ to_ render_ tree - Build a
RenderTreefrom aLayoutDom.