Paged.The open publishing system
The technical handbook
Module commands

Paged Docs / Module commands

paged.draw commands

paged.draw's typed commands — path operations, recipes, the Knife, Shape Builder and other tools as data, Liquify, Puppet Warp, the perspective grid, width profiles.

Tier: IntermediateIntermediateIIreferenceDraft

Reviewed against engine v0.77.0

Every drawing operation the menus offer, as a command with its arguments.

In short Nearly every command of paged.draw has a typed twin with the same id, media.paged.draw.command.<name> (the few left over only open a panel). A command acts on its targets — it selects them first and runs the menu's own code — and is one undo step. Lengths are numbers in points; points on the page are [x, y] in page points. How to call them: Module commands.

The tools as data

The Knife, Scissors, Shape Builder and the scrub tools were tools only; their gesture is now an argument, so a script or the command line can cut.

CommandArgumentsWhat it does
knifetargets, page, cut: [[x, y], …]Cuts the targets along the polyline cut, in the page's points. page: "" takes the page of the first target.
scissorsAttargets, point: [x, y], toleranceSplits the one target path at the point.
shapeBuildtargets, path: [[x, y], …], mode: "keep" | "remove"Merges (keep) or removes (remove) the regions the path crosses. Ovals are refused.
joinScrubtargets, page, path, toleranceThe Join tool: a scrub over a gap joins two open ends, over one path's ends closes it.
pathErasetargets, page, path, widthThe Path Eraser: removes the part of a stroke the scrub covers.
reshapeAttargets, point, to, radius, toleranceThe Reshape tool: drags the contour at point to to, with a falloff of radius.
shaperStroketargets, page, pathThe Shaper: a freehand line, rectangle, ellipse, triangle or polygon drawn clean; a scribble over shapes merges or punches out regions.

A cut that changes nothing fails with the reason (failed: …).

Liquify, Puppet Warp and the perspective grid

The distortion tools as data, each artwork change one undo step:

CommandArgumentsWhat it does
liquifyStroketargets, page, kind: "warp" | "twirl" | "pucker" | "bloat" | "scallop" | "crystallize" | "wrinkle", path: [[x, y], …], and the tool's options (width, height, angle, intensity, detail, simplify, twirlRate, complexity, horizontal, vertical, affectAnchors, affectIn, affectOut, seed)A press at the first point of path, a move per point, a release at the last, over the targets (every path on the page with none). The changed paths are re-fitted and written in one batch.
puppetWarptargets, holds: [[x, y], …], from, to, autoPinsMeshes the targets' outline, places autoPins automatic pins and a pin at each holds point, and drags the pin at from to to.
perspectiveShowGrid, perspectiveHideGrid, perspectiveLockGrid, perspectiveUnlockGridpageThe page's perspective grid.
perspectiveOnePoint, perspectiveTwoPoint, perspectiveThreePointpageThe grid presets.
perspectiveSetPlanepage, plane: "left" | "right" | "floor" | "none"The active plane.
attachToPerspective, releaseFromPerspectivetargetsPuts artwork on the active plane, or takes it off.
moveOnPerspectivetargets, from, toMoves attached artwork along its plane.
drawOnPerspectivepage, shape: "rectangle" | "ellipse", from, toDraws a shape on the active plane.

The grid is a view setting: its edits take no undo step, and artwork attached to it does not follow a later grid edit. A Puppet Warp's pins do not outlast the command.

The width profile

widthProfile { targets, widths } is the Width tool's bake with the profile as data. widths are full stroke widths at evenly spaced stops along the path, by arc length: one width is uniform, [0, 8, 0] swells in the middle and tapers to points. Each target that is a single-contour open path is replaced by its outline, in one batch and one undo step; closed and compound paths are skipped, and a call that outlines nothing fails with the reason. The result is { outlined: n }.

paged-node invoke drawing.paged media.paged.draw.command.widthProfile \
  '{"targets":["polygon:u1f"],"widths":[0,8,0]}' --plugins=@paged-media/draw
{ "command": "media.paged.draw.command.widthProfile", "applied": true, "result": { "outlined": 1 }, … }

In the editor, the Path Options panel's Width profile section types a three-stop profile.

Recipes follow their sources

A pattern, repeat, blend, objects-on-path or live-paint group is a recipe: artwork made from source items. In the editor, an edit that changes a source — a mutation, a panel field, a drag of its handles — rebuilds the recipes it feeds in the same undo step: one undo restores the source and the old artwork, one redo replays both, and an undo or a redo never starts a rebuild. The bundle fingerprints each recipe's sources (anchors and properties) and rebuilds those whose fingerprint moved, once per commit, never per pointer move. It uses the SDK's amended write and is on by default; the Pattern, Repeat, Blend, Objects on path and Live paint panels each carry an Update automatically when a source changes checkbox (the bundle's storage key recipes.autoUpdate).

A script's edits are followed too: a script run is one undo step, and the rebuild joins it. A typed write to a recipe's own parameters (a repeat's count, a blend's steps) rebuilds its artwork in that write's step. Where the automatic update is off, or on a host without the amended write, update explicitly:

CommandArgumentsResult
updateLinkedRecipestargets, all: boolThe addresses of the recipes it rebuilt.

It runs, for every recipe whose sources are among targets (or every recipe, with all: true), the update its own panel runs: updateRepeat, updateBlend, editPatternField, updateObjectsOnPath, regenerateLivePaint. A document without recipes is refused with the reason. The menu row is Draw ▸ Update linked recipes.

The other commands

All take targets (a list of frame addresses) unless noted.

GroupCommands
Gradient presetsfillGradientLinear, fillGradientRadial
Path operationsoutlineStroke { width, cap, join, miterLimit }, offsetPath { delta, join, miterLimit }, simplifyPath { tolerance }, joinEndpoints, closePath, averageEndpoints, reversePathDirection, createOutlines, makeCompoundPath, releaseCompoundPath
BrushesapplyBrush { brush }, removeBrush, brushOptions { scalePct, spacingPct, … }, newBrush { type, name }, applyWidthProfile { profile, points }
EnvelopesenvelopeMakeWithWarp { style, horizontal, bendPct, distortHPct, distortVPct }, envelopeMakeWithMesh { rows, columns }, envelopeMakeWithTopObject, envelopeEditContents, envelopeExpand, expandAppearance
Graphic stylessaveGraphicStyle { name }, applyGraphicStyle { style }, redefineGraphicStyle { style }, breakGraphicStyleLink, renameGraphicStyle { style, name }, deleteGraphicStyle { style }, importGraphicStyles { json }, exportGraphicStyles { styles, save }, mergeGraphicStyles { styles, name }
SymbolsdefineSymbol { name, registration }, placeSymbolInstance { symbol, x, y }, redefineSymbol { symbol }, replaceSymbol { symbol }, symbolOptions { symbol, name, nineSlice }, breakSymbolLink, resetSymbolTransform, renameSymbol, deleteSymbol
Live paintmakeLivePaintGroup { name }, fillLivePaintFace { group, faces, fill }, regenerateLivePaint, selectLivePaintFaces, deleteLivePaintFace, releaseLivePaint
Type on a pathattachTextToPath { story, pathTypeAlignment, flipPathEffect }, detachTextFromPath
Select sameselectSameFill, selectSameStroke, selectSameStrokeWeight { tolerance }, selectSameOpacity, selectSameBlendMode, selectSameAppearance, selectSameGraphicStyle, selectSameSymbolInstance, selectSameShapeKind, globalEdit { tolerance, anySize } — each answers the selection
ShapesinsertArc, insertSpiral, insertRectGrid, insertPolarGrid, insertFlare — the generators' full parameters
Patterns, repeats, blends, objects on a pathmakePatternFromSelection, savePatternSwatch { pattern, name }, makeRadialRepeat, makeGridRepeat, makeMirrorRepeat, blendSelected, makeObjectsOnPath, and per recipe its update, select, expand and release
ColorrecolorArtwork { mode, rule, … }
Image trace and rasterizeimageTrace with the tracer's full option set, retraceImage, rasterize { ppi, background }
GeneratetextToVector { prompt, route }, generativeRecolor { prompt } — through the host's AI and image-model doors; no model ships with the module

paged commands --owner media.paged.draw --text lists each with its exact argument schema.

Moved to the editor. The Pathfinder, the dash and corner presets, the appearance stack's add, clear, remove and move, Reflect and Transform Again and the opacity mask left paged.draw: each now has one implementation in the editor (paged.pathfinder.*, paged.stroke.*, paged.corners.*, paged.appearance.*, paged.transform.*, the Transparency panel), and the media.paged.draw.command.* ids of those verbs are gone. A script reaches the same results through the engine's own operations, such as core.pathfinderBoolean and core.applyOpacityMask.

On this page