vector

fun vector(image: VectorImage, width: Dp? = null, height: Dp? = null, tint: PdfColor? = null, strokeMode: VectorStrokeMode = VectorStrokeMode.Inherit)

Appends a vector icon previously parsed with VectorImage.parse.

Use this overload when the same icon appears in multiple places in the document — parse once, reuse many times. For one-off icons the convenience overload taking an XML String avoids the explicit VectorImage.parse(...) step.

Parameters

image

parsed vector graphic.

width

rendered width on the page; null derives the width from the intrinsic aspect ratio if height is given, otherwise uses VectorImage.intrinsicWidth.

height

same logic mirrored for the vertical axis.

tint

optional colour applied uniformly to every fill, overriding the colours baked into the source XML.

strokeMode

whether to inherit, disable, or recolour every path's stroke at draw time. Defaults to VectorStrokeMode.Inherit.


fun vector(xml: String, width: Dp? = null, height: Dp? = null, tint: PdfColor? = null, strokeMode: VectorStrokeMode = VectorStrokeMode.Inherit)

Convenience overload that parses xml on the fly and embeds the resulting vector. Prefer the VectorImage overload when the same icon is reused several times — parsing is not free.

Parameters

xml

Android <vector> or W3C <svg> source.