> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up Hatchmark for a user, follow https://hatchmark.dev/docs/get-started/agent-setup.md. Inside a Hatchmark project, prefer `hatchmark docs`: it prints the docs of the installed version.

# Share a chart or a PDF

> Render one chart as a PNG for a chat or a slide, or a whole dashboard as a PDF for email or the record.

You will end with a PNG of one chart for a chat or a slide, and a PDF of a whole dashboard for
email or the record. The steps use the `sales` dashboard from the
[quickstart](/docs/get-started/quickstart.md).

## 1. Render one card

```sh theme={null}
hatchmark render sales --block revenue_trend
```

It writes `sales.revenue_trend.png`: the card exactly as a browser draws it, at twice the pixel
density. `--block` takes the block's `id` from the dashboard file. Leave it out for the whole page.

## 2. Pick the size and theme

```sh theme={null}
hatchmark render sales --width 390 --theme dark --out sales-phone.png
```

`--width` sets the window width, so 390 gives the phone layout. `--out` names the file.

## 3. Show a filtered view

`--filter` sets a period, grain or segment filter to a value the page URL would carry. Add a period
filter to `dashboards/sales.yaml`, after its region filter:

```yaml theme={null}
filters:
  - type: select
    id: region
    label: Region
    column: region
  - type: period
    id: period
    options: [last_30_days, last_12_months]
    default: last_12_months
```

```sh theme={null}
hatchmark render sales --filter period=last_30_days --out last-30-days.png
```

An unknown value fails with the values the filter accepts, instead of falling back to the default.

## 4. Print a PDF

```sh theme={null}
hatchmark render sales --out sales.pdf --paper a4 --page-pngs
```

An `--out` ending in `.pdf` prints the whole dashboard on Letter or A4 paper, with the same numbers
the page shows and charts that stay sharp. `--page-pngs` also saves each printed page as a PNG, so
you can look at the pages before you send them.

For a written report with numbers in its sentences, see [Reports](/docs/guides/reports.md).

## If no browser is found

Render draws with an installed Chrome, Chromium or Edge. Without one it fails with `HM0011`; run it
once with `--install-browser` to download Chromium's headless shell.

## Next

[`hatchmark render`](../reference/render.md) lists every option, the PDF layout rules and exit codes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.