# HTML to PDF in Claude

Create PDFs from HTML or web pages in Claude.ai and Claude Desktop. Add html-pdf.com as a custom connector, then ask Claude for the PDF.

**Quick answer:** add a custom connector named `html-pdf` with the URL `https://html-pdf.com/mcp`, click **Connect** and log in with your email, turn it on in the chat, and ask "Make a PDF of https://example.com".

## Get an API key

You need a key before you connect. Sign up at https://html-pdf.com/login and we email you a key, or create one with a single request:

```bash
curl -X POST https://html-pdf.com/v1/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'
```

The key (`hp_live_...`) is shown once. Open the link we email you to confirm your address, which adds 100 free credits. 1 credit = 1 PDF page.

## Connect

This section adds html-pdf.com to Claude as a custom connector. Custom connectors work in Claude on the web, in Claude Desktop and in Cowork. They are available on Free, Pro, Max, Team and Enterprise plans, and Free plans are limited to one custom connector.

**Pro and Max:**

1. Open **Customize → Connectors**.
2. Click **+ Add**, then **Add custom connector**.
3. Name it `html-pdf` and paste this URL, with your key:

```
https://html-pdf.com/mcp
```

4. Save, then turn the connector on for the chat from the tools menu.

**Team and Enterprise:** an owner adds the connector under **Organization settings → Connectors**. Members then enable it from **Customize → Connectors**. Each member should use a URL with their own key.

The key goes in the URL because the connector form only takes a URL. Treat that URL like a password.

## Try it

Once connected, you just ask in plain words. You don't write any code. For example:

- "Write a one-page invoice for Acme Ltd, 3 line items, and give me the PDF."
- "Turn this meeting summary into a nicely formatted A4 PDF with page numbers."
- "Make a PDF of https://example.com/pricing."

Claude returns a download link valid for 24 hours.

## Tips

These requests help you get cleaner PDFs and keep track of credits.

- **Page breaks:** ask for "a new page for each section". Claude adds `break-before: page` in the HTML.
- **Footers with page numbers:** ask for "page X of Y in the footer". Claude uses `pageNumber` and `totalPages` placeholders and sets a margin so the footer has room.
- **Long documents:** ask Claude to set `max_pages`. If the PDF would be longer, nothing is charged.
- **Check your balance:** "How many html-pdf credits do I have left?" calls `get_credits`.

## Troubleshooting

Most problems come from the connector being off or a wrong key in the URL.

- **Claude doesn't use the tool:** make sure the connector is enabled in that chat, and mention "html-pdf" in your request.
- **Authentication errors:** check the `api_key` value in the connector URL. To change it, remove the connector and add it again.
- **403 `email_not_confirmed`:** the email behind the key isn't confirmed yet. Click the link we emailed you (it adds the 100 free credits), then try again.
- **Out of credits:** ask "buy 1,000 html-pdf credits". Claude calls `buy_credits` and gives you a Stripe link. Credits never expire.

## FAQ

### Can Claude create PDF files?

Yes. With the html-pdf.com connector enabled, Claude writes the HTML, renders it and gives you a PDF download link valid for 24 hours.

### Does it work on the free Claude plan?

Yes. Custom connectors are available on the Free plan, which is limited to one custom connector. Pro, Max, Team and Enterprise plans work too.

### How much does it cost?

You get 100 free credits once you confirm your email, with no card. After that, packs go from $10 for 1,000 credits to $250 for 50,000 ($0.01 to $0.005 per page), and purchased credits never expire.

### Is my document stored?

No. The HTML is not stored, and the download link expires after 24 hours.

Full reference: [API docs](https://html-pdf.com/docs) · [MCP server](https://html-pdf.com/mcp)
