Package-level declarations

Types

Link copied to clipboard
data class AnchorNode(val id: String) : PdfNode

Zero-size marker registering a named jump target at the marker's rendered position. Pair with InternalLinkNode to build clickable cross-references and tables of contents.

Link copied to clipboard
data class BarcodeNode(val data: String, val symbology: BarcodeSymbology = BarcodeSymbology.Code128, val width: Dp? = null, val height: Dp = Dp(50f), val color: PdfColor = PdfColor.Black, val background: PdfColor? = PdfColor.White) : PdfNode

A Code 128 barcode rendered as vector bars.

Link copied to clipboard

The 1D barcode symbology a BarcodeNode is encoded with.

Link copied to clipboard
data class BookmarkNode(val title: String, val level: Int = 0) : PdfNode

Zero-size marker that adds an entry to the document outline (the bookmark sidebar in PDF readers) pointing at the marker's rendered position.

Link copied to clipboard
data class BoxChild(val node: PdfNode, val alignment: BoxAlignment)

A single child inside a BoxNode together with its anchor point.

Link copied to clipboard
data class BoxNode(val children: List<BoxChild>, val width: Dp? = null, val height: Dp? = null, val decoration: ContainerDecoration = ContainerDecoration.None) : PdfNode

Z-stacking container. Children are drawn in source order — first added appears at the bottom, last on top. Each child is positioned at one of the nine BoxAlignment anchor points within the box's interior.

Link copied to clipboard
data class ColumnNode(val children: List<PdfNode>, val spacing: Dp = Dp.Zero, val verticalArrangement: VerticalArrangement = VerticalArrangement.Top, val horizontalAlignment: HorizontalAlignment = HorizontalAlignment.Start, val decoration: ContainerDecoration = ContainerDecoration.None) : PdfNode
Link copied to clipboard
data class ContainerDecoration(val background: PdfColor? = null, val cornerRadius: Dp = Dp.Zero, val padding: Padding = Padding.Zero, val border: BorderStroke? = null, val cornerRadiusEach: CornerRadius? = null, val borderEach: BorderSides? = null, val backgroundPaint: PdfPaint? = null, val clipToBounds: Boolean = false, val dropShadow: DropShadow? = null, val rotation: Float = 0.0f, val opacity: Float = 1.0f)

Background, border, padding, and corner-radius decoration shared by every container (ColumnNode, RowNode, BoxNode).

Link copied to clipboard
data class DataMatrixNode(val data: String, val size: Dp? = null, val color: PdfColor = PdfColor.Black, val background: PdfColor? = PdfColor.White) : PdfNode

A Data Matrix (ECC 200) 2D symbol rendered as crisp vector squares.

Link copied to clipboard
data class DividerNode(val thickness: Dp, val color: PdfColor, val style: LineStyle) : PdfNode

Horizontal divider rendered as a single horizontal stroke spanning the available width.

Link copied to clipboard
data class DocumentSpec(val metadata: PdfMetadata, val pages: List<PageSpec>, val customFonts: List<PdfFont.Custom>)

Resolved, immutable description of a document. Produced by the DSL builders and consumed by the layout engine + renderer. Library users normally never see this type — they go through pdf { ... } instead.

Link copied to clipboard
data class FormCheckBoxNode(val name: String, val size: Dp, val checked: Boolean = false) : PdfNode

An interactive AcroForm checkbox.

Link copied to clipboard
data class FormTextFieldNode(val name: String, val width: Dp, val height: Dp, val value: String = "", val multiline: Boolean = false) : PdfNode

An interactive AcroForm text input field.

Link copied to clipboard
data class ImageNode(val bytes: ByteArray, val width: Dp?, val height: Dp?, val contentScale: ContentScale, val allowDownScale: Boolean = true, val altText: String? = null) : PdfNode

A bitmap image embedded in the document.

Link copied to clipboard
data class InternalLinkNode(val anchorId: String, val child: PdfNode) : PdfNode

Wraps child in a clickable region that jumps to the AnchorNode registered under anchorId. Forward references are fine — the target anchor may appear later in the document. Links to anchors that never get registered are silently inert.

Link copied to clipboard
data class KeepTogetherNode(val child: PdfNode) : PdfNode

Wrapper that forbids the page-break machinery from splitting child: under the Slice strategy the wrapped content behaves like MoveToNextPage — it moves to a fresh page whole instead of being cut at an arbitrary line. The CSS equivalent is break-inside: avoid.

Link copied to clipboard
class LazyNode(val resolver: suspend () -> PdfNode) : PdfNode

Placeholder node that defers production of a real PdfNode until a suspend resolution pass runs.

Link copied to clipboard
data class LinkNode(val url: String, val child: PdfNode) : PdfNode

Wraps child in a clickable hyperlink annotation pointing at url.

Link copied to clipboard
data class MultiColumnNode(val children: List<PdfNode>, val count: Int, val gap: Dp, val spacing: Dp) : PdfNode

Newspaper-style multi-column flow: children are measured at the column width and distributed left-to-right into count equal-width columns, balanced so the columns end up roughly the same height.

Link copied to clipboard
data class PageContext(val pageNumber: Int, val totalPages: Int)

Context passed to a page's header / footer builder. Lets the builder vary the rendered content per physical page — typically to inject the current page number or the document's total page count.

Link copied to clipboard
data class PageSpec(val size: PageSize, val padding: Padding, val content: ColumnNode, val pageBreakStrategy: PageBreakStrategy, val header: (PageContext) -> ColumnNode? = null, val footer: (PageContext) -> ColumnNode? = null, val watermark: BoxNode? = null)

One logical page in the source DSL. May expand into multiple physical PDF pages at render time when content overflows.

Link copied to clipboard
sealed interface PdfNode

Sealed hierarchy of layout nodes. Every DSL element produces one of these.

Link copied to clipboard
data class QrCodeNode(val data: String, val errorCorrection: QrErrorCorrection = QrErrorCorrection.M, val size: Dp? = null, val color: PdfColor = PdfColor.Black, val background: PdfColor? = PdfColor.White) : PdfNode

A QR code symbol rendered as crisp vector squares — no rasterisation, so it scans reliably at any print size.

Link copied to clipboard
data class RichTextNode(val spans: List<Span>, val align: TextAlign = TextAlign.Start, val lineHeight: Sp = Sp.Zero) : PdfNode

Multi-style paragraph. A flat list of spans are word-wrapped together across one paragraph box; line breaks happen at word boundaries the same way as a plain TextNode, but each line preserves its underlying span styles instead of collapsing them.

Link copied to clipboard
data class RowNode(val children: List<PdfNode>, val spacing: Dp = Dp.Zero, val horizontalArrangement: HorizontalArrangement = HorizontalArrangement.Start, val verticalAlignment: VerticalAlignment = VerticalAlignment.Top, val decoration: ContainerDecoration = ContainerDecoration.None) : PdfNode
Link copied to clipboard
sealed interface Shape

Discriminator for ShapeNode. Other geometric shapes (squircles, rounded squares, etc.) can plug in here — the renderer dispatches on this variant when generating path commands.

Link copied to clipboard
data class ShapeNode(val shape: Shape, val width: Dp, val height: Dp, val fill: PdfPaint? = null, val strokeColor: PdfColor? = null, val strokeWidth: Dp = Dp.Zero) : PdfNode

Geometric primitive — a circle or ellipse drawn as a filled and / or stroked shape. Use the com.conamobile.pdfkmp.dsl.ContainerScope.circle / com.conamobile.pdfkmp.dsl.ContainerScope.ellipse DSL functions rather than constructing this directly.

Link copied to clipboard
data class SpacerNode(val width: Dp = Dp.Zero, val height: Dp = Dp.Zero) : PdfNode
Link copied to clipboard
data class Span(val text: String, val style: TextStyle)

One contiguous run of text with a single style. Spans are the basic building block of RichTextNode — they let one paragraph mix bold, italic, coloured, or otherwise differently styled segments without breaking out of a single shared line-wrap pass.

Link copied to clipboard
data class TableCellNode(val content: PdfNode, val style: TableCellStyle, val colSpan: Int = 1, val rowSpan: Int = 1)

One cell of a TableRowNode.

Link copied to clipboard
data class TableNode(val columns: List<TableColumn>, val rows: List<TableRowNode>, val headerRow: TableRowNode?, val border: TableBorder, val cornerRadius: Dp, val cellPadding: Padding, val repeatHeader: Boolean = true) : PdfNode

Tabular layout: a fixed sequence of columns and a stream of rows whose cells line up underneath them.

Link copied to clipboard
data class TableRowNode(val cells: List<TableCellNode>, val background: PdfColor? = null, val minHeight: Dp? = null)

One physical row of a TableNode. The number of cells should match the number of TableNode.columns; if a row has fewer cells the trailing columns render as empty, and extra cells are ignored.

Link copied to clipboard
data class TextNode(val text: String, val style: TextStyle) : PdfNode
Link copied to clipboard
data class TocNode(val maxLevel: Int, val style: TextStyle, val indentPerLevel: Dp, val spacing: Dp) : PdfNode

Placeholder for an automatically generated table of contents.

Link copied to clipboard
data class VectorNode(val image: VectorImage, val width: Dp?, val height: Dp?, val tint: PdfColor? = null, val strokeOverride: VectorStrokeMode = VectorStrokeMode.Inherit) : PdfNode

Vector graphic — an SVG / Android <vector> icon embedded into the document at the requested rendered size.

Link copied to clipboard
sealed interface VectorStrokeMode

Per-vector stroke override applied at draw time. Lets the caller drop or recolour stroke outlines without re-authoring the source XML.

Link copied to clipboard
data class WeightNode(val weight: Float, val child: PdfNode) : PdfNode

Wrapper that gives child a fractional share of the parent container's remaining space along the main axis.