---
title: "page.addText: Add text to a page — PDF kit command — Kition"
description: "Add text as page content (not a comment). Place it with at [x, y] (top-left, points from the top-left of the displayed page) and width (wrap width, default 200), or rect. Newlines start new lines; long lines wrap. Style: font helvetica/times/courier or a document font by family (kition-fonts, or one the host added, such as Lora), size, bold, italic, color (#RRGGBB or a name), align left/center/right. Characters the standard fonts lack (Chinese, Japanese) are drawn from a document font that has them; the standard families are drawn from Arimo, Tinos and Cousine when the host added them, so the page embeds every font it uses. It stays editable with content.set. Undoable."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/page.addText"
---

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

# page.addText

**Add text to a page.** Add text as page content (not a comment). Place it with at [x, y] (top-left, points from the top-left of the displayed page) and width (wrap width, default 200), or rect. Newlines start new lines; long lines wrap. Style: font helvetica/times/courier or a document font by family (kition-fonts, or one the host added, such as Lora), size, bold, italic, color (#RRGGBB or a name), align left/center/right. Characters the standard fonts lack (Chinese, Japanese) are drawn from a document font that has them; the standard families are drawn from Arimo, Tinos and Cousine when the host added them, so the page embeds every font it uses. It stays editable with content.set. Undoable.

- 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 |
| --- | --- | --- | --- |
| `align` | `"left" \| "center" \| "right" \| "justify"` | no |  |
| `at` | `number[]` | no | (maxItems 2, minItems 2) |
| `bold` | `boolean` | no |  |
| `color` | `string` | no |  |
| `font` | `"helvetica" \| "times" \| "courier"` | no |  |
| `italic` | `boolean` | no |  |
| `page` | `integer` | yes | (minimum 1) |
| `rect` | `number[]` | no | (maxItems 4, minItems 4) |
| `size` | `number` | no | (maximum 500, minimum 1) |
| `text` | `string` | yes | (minLength 1) |
| `width` | `number` | no |  |

## Call through pdf_run

```text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "page.addText", "params": { "page": <integer>, "text": <string> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `align`, `at`, `bold`, `color`, `font`, `italic`, `rect`, `size`, `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": {
    "align": {
      "enum": [
        "left",
        "center",
        "right",
        "justify"
      ],
      "type": "string"
    },
    "at": {
      "description": "(maxItems 2, minItems 2)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "bold": {
      "type": "boolean"
    },
    "color": {
      "type": "string"
    },
    "font": {
      "enum": [
        "helvetica",
        "times",
        "courier"
      ],
      "type": "string"
    },
    "italic": {
      "type": "boolean"
    },
    "page": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "rect": {
      "description": "(maxItems 4, minItems 4)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "size": {
      "description": "(maximum 500, minimum 1)",
      "type": "number"
    },
    "text": {
      "description": "(minLength 1)",
      "type": "string"
    },
    "width": {
      "type": "number"
    }
  },
  "required": [
    "page",
    "text"
  ],
  "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).
