PDF kit command
file.new
Create a PDF
Create a new, unsaved document and return it like doc_open: `blank` (pages, width, height in points; default 1 US Letter page), `images` (paths of PNG, JPEG, TIFF (every page), GIF or BMP files, one page each at the image's resolution) or `text` (a .txt path, or `text` directly). Save it with doc_save and a path.
- Kit
- PDF 0.1.0 (.pdf)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
dpi | number | no | For images: override the embedded resolution without resampling. 72 gives one point per pixel; omit to use each image's resolution (72 when absent). (maximum 1200, minimum 1) |
from | "blank" | "images" | "text" | yes | |
height | number | no | (minimum 3) |
name | string | no | Name for the new document (default derived from the source). |
pages | integer | no | (maximum 10000, minimum 1) |
text | string | no | |
width | number | no | (minimum 3) |
Call through pdf_run
pdf_run {
"path": "<file>.pdf",
"steps": [{ "command": "file.new", "params": { "from": <"blank" | "images" | "text"> } }]
}The required parameters, with placeholders for their types: not a tested example. Optional: dpi, height, name, pages, text, width. pdf_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
{
"additionalProperties": false,
"properties": {
"dpi": {
"description": "For images: override the embedded resolution without resampling. 72 gives one point per pixel; omit to use each image's resolution (72 when absent). (maximum 1200, minimum 1)",
"type": "number"
},
"from": {
"enum": [
"blank",
"images",
"text"
],
"type": "string"
},
"height": {
"description": "(minimum 3)",
"type": "number"
},
"name": {
"description": "Name for the new document (default derived from the source).",
"type": "string"
},
"pages": {
"description": "(maximum 10000, minimum 1)",
"type": "integer"
},
"text": {
"type": "string"
},
"width": {
"description": "(minimum 3)",
"type": "number"
}
},
"required": [
"from"
],
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (pdf_commands through @kition/[email protected], built from KitionAI/kition-pdf@b0d2725). As data: commands.jsonl.