Normalize viewBox
normalize_viewboxRepair or normalize the document's root viewBox. Synthesizes a missing viewBox from width/height or fixes a malformed one, leaving a valid viewBox unchanged.
Instructions
Normalize or repair the document's root viewBox.
When to use: tidying/repairing a missing or malformed root viewBox. To frame the page to the
art use fit_to_content, to set the page size use resize_canvas.
Key params: none beyond doc_id. A valid 4-number viewBox is left unchanged (idempotent →
changed=False); an absent one is synthesized from numeric width/height; a malformed one is
repaired from width/height when possible.
Return shape: EditResult — operation_id, snapshot_id, changed (real before/after content
diff), before/after preview; the edit lands on the working copy only (reversible).
Example: normalize_viewbox(doc_id)
Render and look before you trust this edit: render with render_preview (or live_render_view)
and inspect the result before relying on it; restore_snapshot reverts it if it is wrong.
Risk class: medium.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| changed | Yes | ||
| summary | No | ||
| snapshot_id | Yes | ||
| operation_id | Yes | ||
| preview_after | No | ||
| preview_before | No |