---
title: "file.new: Create a PDF — PDF kit command — Kition"
description: "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."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/file.new"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/pdf/commands/file.new](https://developer.kition.ai/docs/kits/pdf/commands/file.new)

# 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); reference: [PDF kit commands](https://developer.kition.ai/docs/kits/pdf.md)
- 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

```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/pdf-darwin-arm64@0.1.0 and the kit itself (pdf_commands through @kition/cli@0.1.1, built from KitionAI/kition-pdf@b0d2725).
