---
title: "file.exportBytes: Export to Data — Slide kit command — Kition"
description: "Answers the slides as a PDF, or one slide (or with `all` every slide) as a PNG/JPEG picture, in base64 `data`, without writing a file or changing the presentation."
canonical: "https://developer.kition.ai/docs/kits/slide/commands/file.exportBytes"
---

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

# file.exportBytes

**Export to Data.** Answers the slides as a PDF, or one slide (or with `all` every slide) as a PNG/JPEG picture, in base64 `data`, without writing a file or changing the presentation.

- Kit: Slide 0.1.0 (.kslide and .pptx); reference: [Slide kit commands](https://developer.kition.ai/docs/kits/slide.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `all` | `boolean` | no | png/jpeg: every slide |
| `dpi` | `number (≥ 36, ≤ 600)` | no | dots per inch for PDF pictures |
| `format` | `"pdf" \| "png" \| "jpeg" \| "jpg"` | no | default pdf |
| `frame` | `integer` | no |  |
| `includeHidden` | `boolean` | no |  |
| `perPage` | `1 \| 2 \| 3 \| 4 \| 6 \| 9` | no |  |
| `scale` | `number (≥ 0.01, ≤ 16)` | no | pixels per point for PNG/JPEG |
| `slide` | `integer` | no | a position counted from 0 (the first is 0); png/jpeg; default the current one |
| `slides` | `integer[]` | no |  |
| `textLayer` | `boolean` | no | PDF: keep the text selectable |

## Call through slide_run

```text
slide_run {
  "path": "<file>.pptx",
  "steps": [{ "command": "file.exportBytes" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `all`, `dpi`, `format`, `frame`, `includeHidden`, `perPage`, `scale`, `slide`, `slides`, `textLayer`. slide_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `bytes` | `integer` | no |  |
| `data` | `string` | no |  |
| `files` | `any[]` | no |  |
| `format` | `string` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "bytes": {
      "type": "integer"
    },
    "data": {
      "type": "string"
    },
    "files": {
      "type": "array"
    },
    "format": {
      "type": "string"
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "all": {
      "description": "png/jpeg: every slide",
      "type": "boolean"
    },
    "dpi": {
      "description": "dots per inch for PDF pictures",
      "maximum": 600,
      "minimum": 36,
      "type": "number"
    },
    "format": {
      "description": "default pdf",
      "enum": [
        "pdf",
        "png",
        "jpeg",
        "jpg"
      ],
      "type": "string"
    },
    "frame": {
      "type": "integer"
    },
    "includeHidden": {
      "type": "boolean"
    },
    "perPage": {
      "enum": [
        1,
        2,
        3,
        4,
        6,
        9
      ],
      "type": "integer"
    },
    "scale": {
      "description": "pixels per point for PNG/JPEG",
      "maximum": 16,
      "minimum": 0.01,
      "type": "number"
    },
    "slide": {
      "description": "a position counted from 0 (the first is 0); png/jpeg; default the current one",
      "type": "integer"
    },
    "slides": {
      "items": {
        "description": "a position counted from 0 (the first is 0)",
        "type": "integer"
      },
      "type": "array"
    },
    "textLayer": {
      "description": "PDF: keep the text selectable",
      "type": "boolean"
    }
  },
  "returns": "{data: base64 (the first file), format, bytes, files?: [{slide, data}] (png/jpeg with all)}",
  "type": "object"
}
```

Generated from the command list of @kition/slide-darwin-arm64@0.1.0 and the kit itself (slide_commands through @kition/cli@0.1.1, built from KitionAI/kition-slide@7ef3d11).
