---
title: "page.pageSetup: Page Setup — Sheet kit command — Kition"
description: "Sets a sheet's page setup in one call: orientation, paper size, margins, scaling and print options."
canonical: "https://developer.kition.ai/docs/kits/sheet/commands/page.pageSetup"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/sheet/commands/page.pageSetup](https://developer.kition.ai/docs/kits/sheet/commands/page.pageSetup)

# 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)); reference: [Sheet kit commands](https://developer.kition.ai/docs/kits/sheet.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `bottom` | `number` | no | read by the command beside its listed parameters |
| `cell` | `string` | no | read by the command beside its listed parameters |
| `centerH` | `boolean` | no |  |
| `centerV` | `boolean` | no |  |
| `colBreaks` | `string[]` | no |  |
| `fitHeight` | `integer` | no |  |
| `fitToPage` | `boolean` | no |  |
| `fitWidth` | `integer` | no |  |
| `footer` | `string` | no |  |
| `gridlines` | `boolean` | no |  |
| `header` | `string` | no | like &L&A&RPage &P of &N |
| `headings` | `boolean` | no |  |
| `left` | `number` | no | read by the command beside its listed parameters |
| `margins` | `object` | no | {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 |  |
| `printArea` | `string` | no | like A1:F50; "" clears |
| `range` | `string` | no | read by the command beside its listed parameters |
| `right` | `number` | no | read by the command beside its listed parameters |
| `rowBreaks` | `number[]` | no | [46, 91] |
| `scale` | `integer` | no | 10 to 400 |
| `sheet` | `integer \| string` | no |  |
| `titleCols` | `string` | no | like A:A |
| `titleRows` | `string` | no | like 1:2 |
| `top` | `number` | no | read 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/sheet-darwin-arm64@0.1.0 and the kit itself (sheet_commands through @kition/cli@0.1.1, built from KitionAI/kition-sheet@82f13b2).
