---
title: "file.new: Document — Layout kit command — Kition"
description: "Replaces the open document with a new one from a page preset or size, with page count, facing pages, columns, gutter, margins and bleed."
canonical: "https://developer.kition.ai/docs/kits/layout/commands/file.new"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/layout/commands/file.new](https://developer.kition.ai/docs/kits/layout/commands/file.new)

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

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `bleed` | `number` | no | points |
| `columns` | `integer` | no |  |
| `facingPages` | `boolean` | no |  |
| `gutter` | `number` | no | points |
| `height` | `number` | no |  |
| `margins` | `number \| object` | no |  |
| `pages` | `integer[]` | no |  |
| `preset` | `string` | no | "Letter"\|"A4"\|… |
| `title` | `string` | no |  |
| `width` | `number` | no |  |

## 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/layout-darwin-arm64@0.1.0 and the kit itself (layout_commands through @kition/cli@0.1.1, built from KitionAI/kition-layout@8767a18).
