Layout kit command

file.new

Document

Replaces the open document with a new one from a page preset or size, with page count, facing pages, columns, gutter, margins and bleed.

Kit
Layout 0.1.0 (.klayout)
Changes the document
yes

Parameters

Parameters of file.new
NameTypeRequiredDescription
bleednumbernopoints
columnsintegerno
facingPagesbooleanno
gutternumbernopoints
heightnumberno
marginsnumber | objectno
pagesinteger[]no
presetstringno"Letter"|"A4"|…
titlestringno
widthnumberno

Call through layout_run

text
layout_run {
  "path": "<file>.klayout",
  "steps": [{ "command": "file.new" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: bleed, columns, facingPages, gutter, height, margins, pages, preset, title, width. layout_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "bleed": {
      "description": "points",
      "type": "number"
    },
    "columns": {
      "type": "integer"
    },
    "facingPages": {
      "type": "boolean"
    },
    "gutter": {
      "description": "points",
      "type": "number"
    },
    "height": {
      "type": "number"
    },
    "margins": {
      "oneOf": [
        {
          "description": "points on every side",
          "type": "number"
        },
        {
          "additionalProperties": false,
          "properties": {
            "bottom": {
              "type": "number"
            },
            "inside": {
              "type": "number"
            },
            "outside": {
              "type": "number"
            },
            "top": {
              "type": "number"
            }
          },
          "type": "object"
        }
      ]
    },
    "pages": {
      "items": {
        "type": "integer"
      },
      "type": "array"
    },
    "preset": {
      "description": "\"Letter\"|\"A4\"|…",
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "width": {
      "type": "number"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (layout_commands through @kition/[email protected], built from KitionAI/kition-layout@8767a18). As data: commands.jsonl.