Sheet kit command

page.pageSetup

Page Setup

Sets a sheet's page setup in one call: orientation, paper size, margins, scaling and print options.

Kit
Sheet 0.1.0 (.xlsx (and opens .xlsm, .xls, .xltx, .csv, .ods, .xlsb))
Changes the document
yes

Parameters

Parameters of page.pageSetup
NameTypeRequiredDescription
bottomnumbernoread by the command beside its listed parameters
cellstringnoread by the command beside its listed parameters
centerHbooleanno
centerVbooleanno
colBreaksstring[]no
fitHeightintegerno
fitToPagebooleanno
fitWidthintegerno
footerstringno
gridlinesbooleanno
headerstringnolike &L&A&RPage &P of &N
headingsbooleanno
leftnumbernoread by the command beside its listed parameters
marginsobjectno{left,right,top,bottom,header,footer} (inches; also accepted as top-level keys); inches; also accepted as top-level keys
orientation"portrait" | "landscape"no
paper"Letter" | "Legal" | "A4" | "A3" | "A5" | "Tabloid" | "Executive" | "Ledger" | "B5"no
printAreastringnolike A1:F50; "" clears
rangestringnoread by the command beside its listed parameters
rightnumbernoread by the command beside its listed parameters
rowBreaksnumber[]no[46, 91]
scaleintegerno10 to 400
sheetinteger | stringno
titleColsstringnolike A:A
titleRowsstringnolike 1:2
topnumbernoread by the command beside its listed parameters

Call through sheet_run

text
sheet_run {
  "path": "<file>.xlsx",
  "steps": [{ "command": "page.pageSetup" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: bottom, cell, centerH, centerV, colBreaks, fitHeight, fitToPage, fitWidth, footer, gridlines, header, headings, left, margins, orientation, paper, printArea, range, right, rowBreaks, scale, sheet, titleCols, titleRows, top. sheet_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": {
    "bottom": {
      "description": "read by the command beside its listed parameters",
      "type": "number"
    },
    "cell": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "centerH": {
      "type": "boolean"
    },
    "centerV": {
      "type": "boolean"
    },
    "colBreaks": {
      "items": {
        "description": "like K",
        "type": "string"
      },
      "type": "array"
    },
    "fitHeight": {
      "type": "integer"
    },
    "fitToPage": {
      "type": "boolean"
    },
    "fitWidth": {
      "type": "integer"
    },
    "footer": {
      "type": "string"
    },
    "gridlines": {
      "type": "boolean"
    },
    "header": {
      "description": "like &L&A&RPage &P of &N",
      "type": "string"
    },
    "headings": {
      "type": "boolean"
    },
    "left": {
      "description": "read by the command beside its listed parameters",
      "type": "number"
    },
    "margins": {
      "additionalProperties": true,
      "description": "{left,right,top,bottom,header,footer} (inches; also accepted as top-level keys); inches; also accepted as top-level keys",
      "properties": {
        "bottom": {
          "type": "number"
        },
        "footer": {},
        "header": {},
        "left": {
          "type": "number"
        },
        "right": {
          "type": "number"
        },
        "top": {
          "type": "number"
        }
      },
      "type": "object"
    },
    "orientation": {
      "enum": [
        "portrait",
        "landscape"
      ],
      "type": "string"
    },
    "paper": {
      "enum": [
        "Letter",
        "Legal",
        "A4",
        "A3",
        "A5",
        "Tabloid",
        "Executive",
        "Ledger",
        "B5"
      ],
      "type": "string"
    },
    "printArea": {
      "description": "like A1:F50; \"\" clears",
      "type": "string"
    },
    "range": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "right": {
      "description": "read by the command beside its listed parameters",
      "type": "number"
    },
    "rowBreaks": {
      "description": "[46, 91]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "scale": {
      "description": "10 to 400",
      "type": "integer"
    },
    "sheet": {
      "oneOf": [
        {
          "description": "a sheet position counted from 0",
          "type": "integer"
        },
        {
          "description": "a sheet name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Sheet"
      ]
    },
    "titleCols": {
      "description": "like A:A",
      "type": "string"
    },
    "titleRows": {
      "description": "like 1:2",
      "type": "string"
    },
    "top": {
      "description": "read by the command beside its listed parameters",
      "type": "number"
    }
  },
  "returns": "the sheet's print settings",
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (sheet_commands through @kition/[email protected], built from KitionAI/kition-sheet@82f13b2). As data: commands.jsonl.