Doc kit command
file.export
Export
Answers the document as a PDF, or one page (1-based) as a PNG image at a scale in pixels per point, as base64 for the host to write as a new file; nothing is written and the document does not change.
- Kit
- Doc 0.1.0 (.docx)
- Changes the document
- no
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
format | "pdf" | "png" | no | |
page | integer | no | 1-based, PNG; 1 by default |
scale | any | no | px per pt (PNG, 0.1 to 8; 2 by default); PNG, 0.1 to 8; 2 by default |
Call through doc_run
text
doc_run {
"path": "<file>.docx",
"steps": [{ "command": "file.export" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: format, page, scale. doc_run answers the step’s result in completed[i].result.
Result
| Name | Type | Required | Description |
|---|---|---|---|
bytes | number | no | |
data | string | no | The file's bytes, base64 |
extension | string | no | |
format | "pdf" | "png" | no | |
height | number | no | PNG only: pixels |
mime | string | no | |
width | number | no | PNG only: pixels |
Result JSON Schema
json
{
"additionalProperties": false,
"properties": {
"bytes": {
"type": "number"
},
"data": {
"description": "The file's bytes, base64",
"type": "string"
},
"extension": {
"type": "string"
},
"format": {
"enum": [
"pdf",
"png"
],
"type": "string"
},
"height": {
"description": "PNG only: pixels",
"type": "number"
},
"mime": {
"type": "string"
},
"width": {
"description": "PNG only: pixels",
"type": "number"
}
},
"type": "object"
}Parameter schema
json
{
"additionalProperties": false,
"properties": {
"format": {
"enum": [
"pdf",
"png"
],
"type": "string"
},
"page": {
"description": "1-based, PNG; 1 by default",
"type": "integer"
},
"scale": {
"description": "px per pt (PNG, 0.1 to 8; 2 by default); PNG, 0.1 to 8; 2 by default"
}
},
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (doc_commands through @kition/[email protected], built from KitionAI/kition-doc@41e14a8). As data: commands.jsonl.