Skip to content

writeSvg

writeSvg(laid, opts?): WriteResult

Defined in: src/svg/svg-writer.ts:43

Render a LaidOutDocument to a single SVG preview (ir-design §7 / stage 6). Written purely against the PageDoc schema; knows nothing about OOXML or the PDF writer. PageItem coordinates are already top-left/y-down — SVG’s own frame — so they are emitted verbatim. Pages stack vertically in one <svg>, separated by SvgWriteOptions.pageGap, each on a white outlined rect so they read as pages.

LaidOutDocument

The laid-out, paginated document from the layout engine.

SvgWriteOptions = {}

Optional page-gap override.

WriteResult

The encoded SVG bytes plus the recorded Loss list.