svgPath
Function svgPath
svgPath(options: { borderColor?: RGB; borderWidth?: number; color?: RGB; d: string; height: number; margin?: EdgesInput; scale?: number; width: number } & FlexItemOptions): NodeRender a single SVG path via pdf-lib's drawSvgPath. Useful for logos,
monoline icons, decorative shapes — anything you can express as a single
<path d="…"> string.
Note this is not a full SVG renderer — <rect>, <circle>, <g>,
gradients, and CSS styles aren't supported. Convert your SVG to a single
compound path (e.g. with svgo --pretty --multipass and --inline-paths,
or any "flatten paths" tool) before passing the d string here.
Parameters
-
options: { borderColor?: RGB; borderWidth?: number; color?: RGB; d: string; height: number; margin?: EdgesInput; scale?: number; width: number } & FlexItemOptions
Returns Node