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

Parameters of file.new
NameTypeRequiredDescription
dpinumbernoFor 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
heightnumberno(minimum 3)
namestringnoName for the new document (default derived from the source).
pagesintegerno(maximum 10000, minimum 1)
textstringno
widthnumberno(minimum 3)

Call through pdf_run

text
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

json
{
  "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.