Export object
export_objectExport a single object by its ID to PNG, PDF, or SVG, automatically clipped to its bounding box. Use to extract a specific element from a document.
Instructions
Export a single object (by id) to PNG, PDF, or SVG.
When to use: exporting one object, clipped to its own bbox (get the id from find_objects). For
the whole document use export_document; for many at once use export_batch.
Key params: object_id must exist and match the safe SVG-id charset (else rejected before it
reaches Inkscape). format is one of "png"/"pdf"/"svg". 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 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_object(doc_id, "logo", "svg")
Risk class: low (render/export to a sandbox-checked dir; no original overwrite).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| format | No | png | |
| inline | No | ||
| out_dir | No | ||
| width_px | No | ||
| object_id | Yes | ||
| 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 |