pub enum NodeKind {
Show 27 variants
Page {
config: PageConfig,
},
View,
Text {
content: String,
href: Option<String>,
runs: Vec<TextRun>,
},
Heading {
level: u8,
content: String,
href: Option<String>,
runs: Vec<TextRun>,
},
List {
ordered: bool,
marker_type: ListMarkerType,
start: u32,
},
ListItem,
Image {
src: String,
width: Option<f64>,
height: Option<f64>,
},
Table {
columns: Vec<ColumnDef>,
},
TableRow {
is_header: bool,
},
TableCell {
col_span: u32,
row_span: u32,
},
Fixed {
position: FixedPosition,
pages: FixedPageFilter,
page_name: Option<String>,
exclude_page_names: Vec<String>,
},
PageBreak,
PageName {
name: Option<String>,
},
Svg {
width: f64,
height: f64,
view_box: Option<String>,
content: String,
},
Canvas {
width: f64,
height: f64,
operations: Vec<CanvasOp>,
},
Barcode {
data: String,
format: BarcodeFormat,
width: Option<f64>,
height: f64,
},
QrCode {
data: String,
size: Option<f64>,
},
BarChart {
data: Vec<ChartDataPoint>,
width: f64,
height: f64,
color: Option<String>,
show_labels: bool,
show_values: bool,
show_grid: bool,
title: Option<String>,
},
LineChart {
series: Vec<ChartSeries>,
labels: Vec<String>,
width: f64,
height: f64,
show_points: bool,
show_grid: bool,
title: Option<String>,
},
PieChart {
data: Vec<ChartDataPoint>,
width: f64,
height: f64,
donut: bool,
show_legend: bool,
title: Option<String>,
},
AreaChart {
series: Vec<ChartSeries>,
labels: Vec<String>,
width: f64,
height: f64,
show_grid: bool,
title: Option<String>,
},
DotPlot {
groups: Vec<DotPlotGroup>,
width: f64,
height: f64,
x_min: Option<f64>,
x_max: Option<f64>,
y_min: Option<f64>,
y_max: Option<f64>,
x_label: Option<String>,
y_label: Option<String>,
show_legend: bool,
dot_size: f64,
},
Watermark {
text: String,
font_size: f64,
angle: f64,
},
TextField {
name: String,
value: Option<String>,
placeholder: Option<String>,
width: f64,
height: f64,
multiline: bool,
password: bool,
read_only: bool,
max_length: Option<u32>,
font_size: f64,
},
Checkbox {
name: String,
checked: bool,
width: f64,
height: f64,
read_only: bool,
},
Dropdown {
name: String,
options: Vec<String>,
value: Option<String>,
width: f64,
height: f64,
read_only: bool,
font_size: f64,
},
RadioButton {
name: String,
value: String,
checked: bool,
width: f64,
height: f64,
read_only: bool,
},
}Expand description
The different kinds of nodes in the document tree.
Variants§
Page
A page boundary. Content inside flows according to page config.
Fields
config: PageConfigView
A generic container, analogous to a
Text
A text node with string content.
Fields
Heading
A semantic heading (H1-H6). Lays out as text but carries a level
so the tagged-PDF builder can emit the right /H1…/H6
structure element. The React layer provides sensible default
styles per level; users can override via style.
List
An ordered or unordered list. Children should be ListItem nodes.
Marker numbering continues across page breaks.
Fields
marker_type: ListMarkerTypeWhich marker style to render.
ListItem
One item inside a List. Children are the item content.
Image
An image node.
Fields
Table
A table container. Children should be TableRow nodes.
TableRow
A row inside a Table.
Fields
TableCell
A cell inside a TableRow.
Fixed
A fixed element that repeats on pages (headers, footers, page numbers).
Fields
position: FixedPositionWhere to place this element on the page.
pages: FixedPageFilterWhich pages this element appears on (CSS @page :first
suppression maps to NotFirst). Defaults to all pages.
PageBreak
An explicit page break.
PageName
A marker switching the active page NAME (CSS page property).
When the name changes, the current page is finalized (if it has
content) and subsequent content flows onto pages using the named
config from Document::named_pages. None restores unnamed flow.
Svg
An SVG element rendered as vector graphics.
Fields
Canvas
A canvas drawing primitive with arbitrary vector operations.
Fields
Barcode
A 1D barcode rendered as vector rectangles.
Fields
format: BarcodeFormatBarcode format (Code128, Code39, EAN13, EAN8, Codabar). Default: Code128.
QrCode
A QR code rendered as vector rectangles.
Fields
BarChart
A bar chart rendered as native vector graphics.
Fields
data: Vec<ChartDataPoint>Data points with labels and values.
LineChart
A line chart rendered as native vector graphics.
Fields
series: Vec<ChartSeries>Data series (each with name, data points, optional color).
PieChart
A pie chart rendered as native vector graphics.
Fields
data: Vec<ChartDataPoint>Data points with labels, values, and optional colors.
AreaChart
An area chart rendered as native vector graphics.
Fields
series: Vec<ChartSeries>Data series (each with name, data points, optional color).
DotPlot
A dot plot (scatter plot) rendered as native vector graphics.
Fields
groups: Vec<DotPlotGroup>Groups of data points.
Watermark
A watermark rendered as rotated text behind page content.
Fields
TextField
An interactive text input field (PDF AcroForm widget).
Fields
Checkbox
An interactive checkbox (PDF AcroForm widget).
Fields
Dropdown
An interactive dropdown/combo box (PDF AcroForm widget).
Fields
RadioButton
An interactive radio button (PDF AcroForm widget).
Multiple RadioButtons with the same name form a mutually exclusive group.