Slide kit command

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)
Changes the document
no

Parameters

Parameters of file.exportBytes
NameTypeRequiredDescription
allbooleannopng/jpeg: every slide
dpinumber (≥ 36, ≤ 600)nodots per inch for PDF pictures
format"pdf" | "png" | "jpeg" | "jpg"nodefault pdf
frameintegerno
includeHiddenbooleanno
perPage1 | 2 | 3 | 4 | 6 | 9no
scalenumber (≥ 0.01, ≤ 16)nopixels per point for PNG/JPEG
slideintegernoa position counted from 0 (the first is 0); png/jpeg; default the current one
slidesinteger[]no
textLayerbooleannoPDF: 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

Result of file.exportBytes
NameTypeRequiredDescription
bytesintegerno
datastringno
filesany[]no
formatstringno
Result JSON Schema
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/[email protected] and the kit itself (slide_commands through @kition/[email protected], built from KitionAI/kition-slide@7ef3d11). As data: commands.jsonl.