Export document
export_documentExport the entire document to PNG, PDF, or SVG for final output. Accepts pixel width for PNG and sandbox-checked output directory.
Instructions
Export the whole document to PNG, PDF, or SVG.
When to use: producing a final file of the whole document. For one object use export_object;
for many sizes/formats at once use export_batch; for a web/print bundle use the profile tools.
Key params: format is one of "png"/"pdf"/"svg" (others rejected). PNG honors width_px
(pixel-capped before Inkscape runs); PDF/SVG are vector and ignore it. out_dir writes
into a caller-chosen dir — a relative out_dir anchors to the workspace ROOT and is
sandbox-checked (out-of-workspace is rejected with "path rejected: outside workspace");
name_prefix tags the filename. INLINE RASTER: a PNG is returned inline by default
(gated by max_output_bytes); PDF/SVG are never embedded; inline=False opts out.
Return shape: ExportResult — artifact_path / workspace_relative_path (same value),
format, width_px/height_px (TRUE size for PNG, None for vector), stale. With an inline
image, a ToolResult carrying the same fields plus the image block.
Example: export_document(doc_id, "png", width_px=1024)
Risk class: low (render/export to a sandbox-checked dir; no original overwrite).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| format | Yes | ||
| inline | No | ||
| out_dir | No | ||
| width_px | No | ||
| name_prefix | No | ||
| max_output_bytes | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stale | No | ||
| doc_id | Yes | ||
| format | Yes | ||
| width_px | Yes | ||
| all_blank | No | ||
| height_px | Yes | ||
| is_vector | No | ||
| opaque_px | No | ||
| artifact_path | Yes | ||
| fonts_outlined | No | ||
| workspace_relative_path | Yes |