Create document
create_documentCreate a blank Inkscape SVG document with specified width, height, optional viewBox and background color. No source file required.
Instructions
Create a blank, tracked working-copy document from scratch — NO source file required.
When to use: starting fresh authoring with the create_* / compose tools when there is no SVG
to open. To open an EXISTING file use open_document; to set the whole SVG body afterwards use
set_document_svg.
Key params: width / height are the page size in user units (both > 0). viewBox is an
optional explicit "minx miny w h" box (a 0 0 width height box is synthesized when omitted,
so the document is never viewBox-less). background is an optional validated colour (hex /
rgb() / hsl() / named keyword — never CSS-injectable) painted as a full-page rect; omit for
a transparent page. The generated document is validate_document-clean.
Return shape: OpenDocumentResult (same as open_document) — doc_id (addresses a fully
tracked working copy: snapshots, reversibility, reload) and summary.
Example: create_document(800, 600, background="#ffffff")
Risk class: medium (creates a new tracked document; no existing state mutated).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | ||
| height | Yes | ||
| viewBox | No | ||
| background | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| summary | Yes | Top-level document summary (viewBox / page / size / counts). |