Skip to main content

Module render_bridge

Module render_bridge 

Source
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§

CoordinateMapper
Maps XFA coordinates (top-left origin) to PDF coordinates (bottom-left origin).
FontMetricsData
Resolved font metrics for a typeface, used for accurate text measurement.
ImageInfo
Image data collected during rendering for XObject embedding.
PageOverlay
Overlay result for a single page, including content stream and images.
RenderTree
The full intermediate render tree for a document.
XfaRenderConfig
Configuration for PDF overlay rendering.

Enums§

RenderNode
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 RenderTree from a LayoutDom.