---
title: "file.flatten: Flatten — PDF kit command — Kition"
description: "Merge comment and/or form field appearances into the page content, so they print and display everywhere but can no longer be edited. Undoable until saved."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/file.flatten"
---

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

# file.flatten

**Flatten.** Merge comment and/or form field appearances into the page content, so they print and display everywhere but can no longer be edited. Undoable until saved.

- 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 |
| --- | --- | --- | --- |
| `comments` | `boolean` | no | Flatten comments. Default: true, or the opposite of fields when only fields is given. |
| `fields` | `boolean` | no | Flatten form fields. Default: true, or the opposite of comments when only comments is given. |

## Call through pdf_run

```text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "file.flatten" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `comments`, `fields`. 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": {
    "comments": {
      "description": "Flatten comments. Default: true, or the opposite of fields when only fields is given.",
      "type": "boolean"
    },
    "fields": {
      "description": "Flatten form fields. Default: true, or the opposite of comments when only comments is given.",
      "type": "boolean"
    }
  },
  "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).
