Package-level declarations

Types

Link copied to clipboard

Position of a child inside a com.conamobile.pdfkmp.dsl.box.

Link copied to clipboard

How a column's children are aligned along the cross-axis (horizontal) when they have different intrinsic widths.

Link copied to clipboard

How children of a com.conamobile.pdfkmp.dsl.RowScope are distributed along the horizontal axis when their combined intrinsic width is smaller than the row's available width.

Link copied to clipboard

Automatic hyphenation using Frank Liang's pattern-matching algorithm — the same approach TeX uses.

Link copied to clipboard

Bundled HyphenationPatterns language sets.

Link copied to clipboard
data class JustifiedWord(val text: String, val x: Float, val width: Float)

One word positioned by full justification. The layout engine pre-computes the x-offset of every word so the renderer can draw justified lines with one drawText call per word and zero extra math.

Link copied to clipboard
data class MeasuredAnchor(val id: String, val size: Size) : MeasuredNode

Measurement result for an com.conamobile.pdfkmp.node.AnchorNode — zero-size; the renderer registers the named destination at its position.

Link copied to clipboard
data class MeasuredBarcode(val barcode: Code128Barcode, val color: PdfColor, val background: PdfColor?, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.BarcodeNode. Carries the encoded bar/space module widths so the renderer can emit the bars without re-running the encoder.

Link copied to clipboard
data class MeasuredBlock(val size: Size) : MeasuredNode

Measurement result for a fixed-size block (e.g. a spacer).

Link copied to clipboard
data class MeasuredBookmark(val title: String, val level: Int, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.BookmarkNode — zero-size; the renderer registers the outline entry at its position.

Link copied to clipboard
data class MeasuredBox(val children: List<PlacedChild>, val size: Size, val decoration: ContainerDecoration = ContainerDecoration.None) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.BoxNode. Children are stored with their pre-computed (offsetX, offsetY) so the renderer does not need to redo alignment math at draw time.

Link copied to clipboard
data class MeasuredColumn(val children: List<PlacedChild>, val size: Size, val decoration: ContainerDecoration = ContainerDecoration.None) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.ColumnNode.

Link copied to clipboard
data class MeasuredDataMatrix(val matrix: DataMatrix, val color: PdfColor, val background: PdfColor?, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.DataMatrixNode. The module matrix is computed during measurement (pure common code) so the renderer only has to turn dark modules into filled rectangles, exactly like MeasuredQrCode.

Link copied to clipboard
data class MeasuredDivider(val thickness: Float, val color: PdfColor, val style: LineStyle, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.DividerNode.

Link copied to clipboard
data class MeasuredFormCheckBox(val name: String, val checked: Boolean, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.FormCheckBoxNode — always a square of size × size.

Link copied to clipboard
data class MeasuredFormTextField(val name: String, val value: String, val multiline: Boolean, val fontSizePt: Float, val size: Size) : MeasuredNode
Link copied to clipboard
data class MeasuredImage(val bytes: ByteArray, val contentScale: ContentScale, val size: Size, val allowDownScale: Boolean = true, val altText: String? = null) : MeasuredNode

Measurement result for an image node.

Link copied to clipboard
data class MeasuredInternalLink(val anchorId: String, val child: MeasuredNode, val size: Size) : MeasuredNode

Measurement result for an com.conamobile.pdfkmp.node.InternalLinkNode. Mirrors MeasuredLink but jumps to a named destination instead of a URL.

Link copied to clipboard
data class MeasuredKeepTogether(val child: MeasuredNode, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.KeepTogetherNode — forwards the child's size; the renderer refuses to slice it.

Link copied to clipboard
data class MeasuredLink(val url: String, val child: MeasuredNode, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.LinkNode. The wrapper simply forwards child's size — the URL is attached to the surrounding rectangle at draw time.

Link copied to clipboard
sealed interface MeasuredNode

Output of measuring a layout node. Consumed by the renderer when placing the node onto a page.

Link copied to clipboard
data class MeasuredQrCode(val matrix: QrMatrix, val color: PdfColor, val background: PdfColor?, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.QrCodeNode. The module matrix is computed during measurement (pure common code) so the renderer only has to turn dark modules into filled rectangles.

Link copied to clipboard
data class MeasuredRichText(val lines: List<RichLine>, val align: TextAlign, val paragraphWidth: Float, val size: Size, val resolvedDirection: TextDirection = TextDirection.Ltr) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.RichTextNode.

Link copied to clipboard
data class MeasuredRow(val children: List<PlacedChild>, val size: Size, val decoration: ContainerDecoration = ContainerDecoration.None) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.RowNode. Mirrors MeasuredColumn but stacks children left-to-right.

Link copied to clipboard
data class MeasuredShape(val shape: Shape, val fill: PdfPaint?, val strokeColor: PdfColor?, val strokeWidth: Float, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.ShapeNode.

Link copied to clipboard
data class MeasuredTable(val columnWidths: List<Float>, val rows: List<MeasuredTableRow>, val border: TableBorder, val borderColor: PdfColor, val borderWidth: Float, val cornerRadius: Float, val size: Size, val repeatHeader: Boolean = true, val cellOwners: List<List<Int>> = emptyList()) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.TableNode.

Link copied to clipboard
data class MeasuredTableCell(val content: MeasuredNode, val style: TableCellStyle, val offsetX: Float, val width: Float, val contentOffsetX: Float, val contentOffsetY: Float, val columnIndex: Int = 0, val colSpan: Int = 1, val rowSpan: Int = 1, val spannedHeight: Float = 0.0f)

One measured cell in a MeasuredTableRow.

Link copied to clipboard
data class MeasuredTableRow(val height: Float, val cells: List<MeasuredTableCell>, val background: PdfColor?, val isHeader: Boolean)

One measured row in a MeasuredTable.

Link copied to clipboard
data class MeasuredText(val lines: List<TextLine>, val style: TextStyle, val size: Size, val paragraphWidth: Float = size.width, val resolvedDirection: TextDirection = TextDirection.Ltr) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.TextNode.

Link copied to clipboard
data class MeasuredVector(val image: VectorImage, val tint: PdfColor?, val strokeOverride: VectorStrokeMode, val size: Size) : MeasuredNode

Measurement result for a com.conamobile.pdfkmp.node.VectorNode.

Link copied to clipboard

Strategy used when a child element does not fit in the remaining vertical space of the current page.

Link copied to clipboard
data class PlacedChild(val node: MeasuredNode, val offsetX: Float, val offsetY: Float)

A child node positioned within a MeasuredColumn or MeasuredRow.

Link copied to clipboard
data class RichLine(val segments: List<RichSegment>, val totalWidth: Float, val baseline: Float, val height: Float)

One wrapped line of a RichTextNode paragraph.

Link copied to clipboard
data class RichSegment(val text: String, val style: TextStyle, val xOffset: Float, val width: Float, val yOffset: Float = 0.0f)

One segment of a wrapped rich-text line. Multiple segments make up a RichLine; each segment carries its own style so the renderer can issue a single drawText call per segment without losing the per-span formatting.

Link copied to clipboard
data class TextLine(val text: String, val width: Float, val baseline: Float, val height: Float, val justifiedWords: List<JustifiedWord> = emptyList())

One word-wrapped segment of text plus the position of its baseline relative to the top of the surrounding MeasuredText block.

Link copied to clipboard

How a row's children are aligned along the cross-axis (vertical) when they have different intrinsic heights.

Link copied to clipboard

How children of a com.conamobile.pdfkmp.dsl.ColumnScope are distributed along the vertical axis when their combined intrinsic height is smaller than the column's available height.

Functions

Link copied to clipboard
fun layoutRichText(spans: List<Span>, maxWidth: Float, align: TextAlign, paragraphLineHeight: Sp, metrics: FontMetrics): MeasuredRichText

Word-wraps the supplied spans across maxWidth.

Link copied to clipboard
fun layoutText(text: String, style: TextStyle, maxWidth: Float, metrics: FontMetrics): MeasuredText

Soft-wraps a string into lines that fit within maxWidth.

Link copied to clipboard
fun measure(node: PdfNode, constraints: Constraints, metrics: FontMetrics): MeasuredNode

Recursive layout pass that turns a PdfNode tree into a MeasuredNode tree.