---
name: "documents_create_pdf"
area: "documents"
title: "Make a PDF"
price: "$0.02"
method: "POST"
url: "https://api.conecto.chat/v1/tools/documents_create_pdf"
mcp_server: "https://api.conecto.chat/mcp/documents"
auth: "Authorization: Bearer <conecto_sk_ key>"
docs_url: "https://conecto.chat/tools/documents/documents_create_pdf"
---

# Make a PDF (`documents_create_pdf`)

Makes a PDF from Markdown or HTML and saves it in the file store with a download link.

A PDF from Markdown or HTML, saved in the file store with a download link. Markdown gets a clean document style (headings, tables, lists); HTML is printed the way Chrome prints it, without running JavaScript. Images must be public https links or data: URLs. Give exactly one of markdown or html.

Price: $0.02 a call. A call that fails costs nothing.

## Use it when

The business needs a document as a PDF: a guide, a letter, a report, a price list.

- For a quote or invoice with numbering and a payment page, use [invoices_create](https://conecto.chat/tools/invoices/invoices_create.md).
- For a Word file turned into a PDF, use [documents_convert_to_pdf](https://conecto.chat/tools/documents/documents_convert_to_pdf.md).

## Say this to your agent

> Make a one-page PDF of our care guide for the combi steamer, to put in every delivery box.

## Inputs

| Name | Type | Required | Description | Allowed values | Default |
|---|---|---|---|---|---|
| `name` | string | yes | Name for the new file, e.g. "Quote 1042.pdf". 1 to 200 characters. |  |  |
| `markdown` | string | no | Up to 500,000 characters. |  |  |
| `html` | string | no | Up to 1,000,000 characters. |  |  |
| `css` | string | no | Extra CSS, e.g. a font size or a logo. Up to 50,000 characters. |  |  |
| `paper` | string | no |  | `"a4"`, `"letter"`, `"legal"` | `"a4"` |
| `landscape` | boolean | no |  |  | `false` |
| `margin_mm` | integer | no | 0 to 50. |  | `18` |
| `link_hours` | integer | no | 1 to 168. |  | `24` |

## Example

Written for Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff.

MCP: call `documents_create_pdf` on the MCP server `https://api.conecto.chat/mcp/documents` with these arguments:

```json
{
  "name": "Caring for your combi steamer.pdf",
  "paper": "a4",
  "markdown": "# Caring for your combi steamer\n\nRun the cleaning program every evening and leave the door open overnight. Skip scouring pads: they scratch the steel.\n\n## Once a month\n\n1. Descale the steam generator.\n2. Check the door seal for cracks.\n3. Clean the air filter behind the side panel.\n\nQuestions? service@hansenvoss.example"
}
```

REST:

```bash
curl https://api.conecto.chat/v1/tools/documents_create_pdf \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Caring for your combi steamer.pdf", "paper": "a4", "markdown": "# Caring for your combi steamer\n\nRun the cleaning program every evening and leave the door open overnight. Skip scouring pads: they scratch the steel.\n\n## Once a month\n\n1. Descale the steam generator.\n2. Check the door seal for cracks.\n3. Clean the air filter behind the side panel.\n\nQuestions? service@hansenvoss.example"}'
```

## Response

```json
{
  "call_id": "5f0c8a2e-3b7d-4c1e-9a64-2d8e1f7b0c93",
  "tool": "documents_create_pdf",
  "status": "succeeded",
  "replayed": false,
  "cost_usd": "$0.02",
  "balance_usd": "$19.75",
  "result": {
    "file": {
      "file_id": "6f774aa4-fff8-48ff-be34-dc1920af486a",
      "name": "Caring for your combi steamer.pdf",
      "content_type": "application/pdf",
      "size": "582 bytes",
      "size_bytes": 582,
      "sha256": "7a628ee1199dd863f0236a61a39b6729a977b4ea18a669e9930a57280cb2326e",
      "created_at": "2026-10-14T08:00:00+00:00",
      "download_url": "https://cncto.co/d/6f774aa4-fff8-48ff-be34-dc1920af486a?t=eyJmIjoiNmY3NzRhYTQtZmZmOC00OGZmLWJlMzQtZGMxOTIwYWY0ODZhIiwiZXhwIjoxNzkyMTYxNjAzfQ:1xHMcl:pH5nN_64b3kqVHQwzoHWTu1Zuz_ryqyYfuK2UzR6VS4",
      "link_expires_in_hours": 24
    },
    "pages": 1
  }
}
```

`result`: file: the new PDF with its file_id, name, type, size, download link and link expiry; and pages.

## Errors

| Code | Status | When | Fix |
|---|---|---|---|
| `invalid_input` | 400 | Neither or both of markdown and html were given. | Give exactly one of them. |
| `conversion_failed` | 422 | The content could not be made into a PDF. | Check the HTML or Markdown. |
| `storage_full` | 409 | The file store has no room for the new file. | Delete files with files_delete, or add room with files_add_storage. |
| `too_large` | 413 | The result would be over 25 MB. | Make it smaller, or split it. |
| `unavailable` | 503 | Making PDFs is not switched on, or the PDF service did not answer. | Try again in a moment; nothing was charged. |

The refusals every tool can give (401 key, 402 balance, 429 limits) are on the errors page: https://conecto.chat/docs/errors.md

## Related

- [documents_convert_to_pdf](https://conecto.chat/tools/documents/documents_convert_to_pdf.md): Turns a Word, Excel, PowerPoint, OpenDocument, RTF, CSV, text, Markdown or HTML file into a PDF; the original stays. $0.02 a call.
- [documents_template_fields](https://conecto.chat/tools/documents/documents_template_fields.md): The placeholders in a Word (.docx) template, so you know what data filling it needs. Free up to 1,000,000 reads a month.
- [documents_fill_template](https://conecto.chat/tools/documents/documents_fill_template.md): Makes a new Word file from a .docx template, its placeholders filled from data. $0.02 a call.
- [documents_merge_pdfs](https://conecto.chat/tools/documents/documents_merge_pdfs.md): Makes one PDF from several in the store, in the order given. $0.01 a call.
- [documents_read_pdf](https://conecto.chat/tools/documents/documents_read_pdf.md): The text of a PDF in the store, page by page, up to 50 pages a call. Free up to 1,000,000 reads a month.
- [documents_page_images](https://conecto.chat/tools/documents/documents_page_images.md): The pages of a scanned PDF or a photo of a document as images to look at, up to 10 pages a call. $0.005 a call.
- [documents_create_deck](https://conecto.chat/tools/documents/documents_create_deck.md): A PowerPoint deck from your slides, plain or in the business's template, with editable charts, tables and each slide's sources. $0.10 a call.
