Vector kit command

file.serialize

Serialize Document

Answers the active document as file data in a format (native by default, SVG, PDF, raster and more) without writing a file or changing the document.

Kit
Vector 0.1.0 (.kvector)
Changes the document
no

Parameters

Parameters of file.serialize
NameTypeRequiredDescription
format"kvector" | "template" | "svg" | "svgz" | "pdf" | "png" | "jpg" | "webp" | "gif" | "png8" | "txt" | "dxf" | "eps" | "emf" | "wmf" | "tiff" | "bmp" | "tga" | "psd"nodefault
idsany[]noread by the command beside its listed parameters
selectedOnlybooleannothe selected objects alone, in their layers

Call through vector_run

text
vector_run {
  "path": "<file>.kvector",
  "steps": [{ "command": "file.serialize" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: format, ids, selectedOnly. vector_run answers the step’s result in completed[i].result.

Result

Result of file.serialize
NameTypeRequiredDescription
dataBase64stringno
textanyno
warningsany[]no
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "dataBase64": {
      "type": "string"
    },
    "text": {},
    "warnings": {
      "type": "array"
    }
  },
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "format": {
      "description": "default",
      "enum": [
        "kvector",
        "template",
        "svg",
        "svgz",
        "pdf",
        "png",
        "jpg",
        "webp",
        "gif",
        "png8",
        "txt",
        "dxf",
        "eps",
        "emf",
        "wmf",
        "tiff",
        "bmp",
        "tga",
        "psd"
      ],
      "type": "string"
    },
    "ids": {
      "description": "read by the command beside its listed parameters",
      "type": "array"
    },
    "selectedOnly": {
      "default": false,
      "description": "the selected objects alone, in their layers",
      "type": "boolean"
    }
  },
  "returns": "{text, warnings} for svg (plus dataBase64, the file, when its encoding isn't UTF-8), else {dataBase64, warnings}; an SVG of several artboards also gives files: [{name, text}], linked images linked: [{name, dataBase64}]",
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (vector_commands through @kition/[email protected], built from KitionAI/kition-vector@7cf908f). As data: commands.jsonl.