pub struct LayoutElement {Show 18 fields
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
pub draw: DrawCommand,
pub children: Vec<LayoutElement>,
pub node_type: Option<String>,
pub resolved_style: Option<ResolvedStyle>,
pub source_location: Option<SourceLocation>,
pub href: Option<String>,
pub bookmark: Option<String>,
pub alt: Option<String>,
pub is_header_row: bool,
pub list_numbering: Option<&'static str>,
pub actual_text: Option<String>,
pub col_span: u32,
pub overflow: Overflow,
pub opacity: f64,
}Expand description
A positioned element on a page.
Fields§
§x: f64Absolute position on the page (top-left corner).
y: f64§width: f64Dimensions including padding and border, excluding margin.
height: f64§draw: DrawCommandThe visual properties to draw.
children: Vec<LayoutElement>Child elements (positioned relative to page, not parent).
node_type: Option<String>Logical node type for dev tools (e.g. “View”, “Text”, “Image”).
resolved_style: Option<ResolvedStyle>Resolved style snapshot for inspector panel.
source_location: Option<SourceLocation>Source code location for click-to-source in the dev inspector.
href: Option<String>Optional hyperlink URL for link annotations.
bookmark: Option<String>Optional bookmark title for PDF outline entries.
alt: Option<String>Optional alt text for images and SVGs (accessibility).
is_header_row: boolWhether this is a table header row (for tagged PDF: TH vs TD).
list_numbering: Option<&'static str>ListNumbering attribute value for List elements (ISO 14289-2
8.2.5.25: required on /L when Lbl children are present). None for
every non-List element and for markerType “none”, which draws no
marker (and therefore no Lbl).
actual_text: Option<String>Replacement text for machine-readable graphics: the encoded data of
a Barcode or QrCode. Under PDF/UA-2 a Figure needs /Alt or
/ActualText (ISO 14289-2 8.2.5.28.2); when the author gave no alt,
the encoded payload IS the content’s text. None elsewhere.
col_span: u32Number of columns this table cell spans (for tagged PDF: /ColSpan). 1 for every non-cell element and for unspanned cells.
overflow: OverflowOverflow behavior (Visible or Hidden). When Hidden, PDF clips children.
opacity: f64Opacity for the entire element including its children (0.0–1.0). The
PDF serializer wraps write_element in a q\n/GS{n} gs ... Q block
when this is < 1.0, so descendants render at the cumulative alpha.
Default is 1.0 (no extra wrap).