---
title: "file.export: Export — Board kit command — Kition"
description: "Draws the shown page (or `page`, or one frame) as PNG, SVG or PDF and answers the file as base64 without changing the board."
canonical: "https://developer.kition.ai/docs/kits/board/commands/file.export"
---

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

# file.export

**Export.** Draws the shown page (or `page`, or one frame) as PNG, SVG or PDF and answers the file as base64 without changing the board.

- Kit: Board 0.1.0 (.kboard); reference: [Board kit commands](https://developer.kition.ai/docs/kits/board.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `background` | `boolean` | no | A white page behind the board (true by default; PDF pages are always white) |
| `fit` | `boolean` | no | A PNG too large at its scale is drawn at the largest scale that fits instead of refused |
| `format` | `"png" \| "svg" \| "pdf"` | yes | The file to write |
| `frame` | `string` | no | One frame and what is in it, instead of the whole page |
| `page` | `string` | no | The page's id; the shown page when absent |
| `scale` | `number (≥ 0.1, ≤ 8)` | no | PNG pixels per board unit, 0.1 to 8 (2 by default) |

## Call through board_run

```text
board_run {
  "path": "<file>.kboard",
  "steps": [{ "command": "file.export", "params": { "format": <"png" | "svg" | "pdf"> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `background`, `fit`, `frame`, `page`, `scale`. board_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `base64` | `string` | yes | The file's bytes |
| `extension` | `string` | yes |  |
| `format` | `"png" \| "svg" \| "pdf"` | yes |  |
| `height` | `number` | yes |  |
| `mime` | `string` | yes |  |
| `width` | `number` | yes |  |

```json
{
  "additionalProperties": false,
  "properties": {
    "base64": {
      "description": "The file's bytes",
      "type": "string"
    },
    "extension": {
      "type": "string"
    },
    "format": {
      "enum": [
        "png",
        "svg",
        "pdf"
      ],
      "type": "string"
    },
    "height": {
      "type": "number"
    },
    "mime": {
      "type": "string"
    },
    "width": {
      "type": "number"
    }
  },
  "required": [
    "base64",
    "extension",
    "format",
    "height",
    "mime",
    "width"
  ],
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "background": {
      "description": "A white page behind the board (true by default; PDF pages are always white)",
      "type": "boolean"
    },
    "fit": {
      "description": "A PNG too large at its scale is drawn at the largest scale that fits instead of refused",
      "type": "boolean"
    },
    "format": {
      "description": "The file to write",
      "enum": [
        "png",
        "svg",
        "pdf"
      ],
      "type": "string"
    },
    "frame": {
      "description": "One frame and what is in it, instead of the whole page",
      "type": "string",
      "x-khp-types": [
        "Element"
      ]
    },
    "page": {
      "description": "The page's id; the shown page when absent",
      "type": "string",
      "x-khp-types": [
        "Page"
      ]
    },
    "scale": {
      "description": "PNG pixels per board unit, 0.1 to 8 (2 by default)",
      "maximum": 8,
      "minimum": 0.1,
      "type": "number"
    }
  },
  "required": [
    "format"
  ],
  "type": "object"
}
```

Generated from the command list of @kition/board-darwin-arm64@0.1.0 and the kit itself (board_commands through @kition/cli@0.1.1, built from KitionAI/kition-board@e78c190).
