# read_pdf

The `read_pdf` step.

Reads the tables of a PDF the job has stored: the page the job is on when it is a PDF, or a named artifact such as a `download`'s. Cells are returned exactly as printed, as strings; a table that continues over pages is one table. The file already passed the [PDF security gate](https://docs.kaab.ist/concepts/documents-and-pdfs); nothing is fetched again. Lint warns `W010` when no earlier `goto` or `download` could have produced the PDF.

Type: `object`

## Keys

| Key | Type | Description |
|---|---|---|
| `read_pdf.artifact` | `string` | The artifact to read, a template: a `download`'s `name`, with or without the extension the download added. Without it the step reads the PDF the page is. A literal name that keeps nothing is lint `E014`. |
| `read_pdf.field` | `string` | The key the reading is stored under, in `data` or `vars`. Defaults to `pdf`. |
| `read_pdf.include_text` | `boolean` | Also return each read page's text lines, to see the headings above a table. Defaults to `false`. |
| `read_pdf.into` | `"data" \| "vars"` | Where the reading goes: `data` (the default), the job's result, or `vars`, for later templates and conditions. |
| `read_pdf.max_pages` | `integer` | The most pages to read, from `1` to `500`. Defaults to `500`, the PDF gate's page limit; a longer document is read up to here with `truncated: true` and a `pdf_pages_truncated` warning. |
| `read_pdf.min_table_rows` | `integer` | The fewest lines with two or more cells a table needs, from `1` to `20`. Defaults to `3`; set `2` or `1` to keep a header with one row or a two-row block. A line with a single cell (a section heading, a wrapped description) between two parts of a table is a row of that table either way, with one non-empty cell in the column its text starts in; it is not counted here. |

Every step also takes the [common step keys](https://docs.kaab.ist/reference/dsl/steps#common-keys): `expect`, `id`, `if`, `name`, `on_error`, `optional`, `retry`, `side_effect`, `timeout_ms`, `x_kaab`.
