Can Claude create PDFs? How to make Claude create a PDF

Can Claude create PDFs? How to make Claude create a PDF

Can Claude create PDFs? Yes. Turn on file creation in Claude.ai, generate PDFs in Claude Code, and get well-designed PDFs from HTML and CSS.

Quick answer. In Claude Code, connect the html-pdf.com MCP server with one command, then ask Claude for a PDF. In Claude.ai, add https://html-pdf.com/mcp?api_key=hp_live_... as a custom connector instead.

claude mcp add --transport http html-pdf https://html-pdf.com/mcp \
  --header "Authorization: Bearer $HTML_PDF_KEY"

Claude can create downloadable PDF files in Claude.ai, Claude Desktop and Claude Code. This guide explains how each route works, which settings to turn on, and which prompts produce good-looking documents. It also shows how to connect a renderer so Claude's HTML becomes a pixel-accurate PDF.

Can Claude create PDF files?

Yes. Claude creates files by writing and running code in a private sandbox, then attaching the result to the chat for you to download. Anthropic lists PDF alongside Word, Excel and PowerPoint files, and the feature is called Code execution and file creation.

Here is how to turn it on.

Then ask for a file in plain words.

Create a PDF of this meeting summary: A4, a title, the action items as a table, and page numbers. Give me the file to download.

If Claude replies with text only, check that the setting is on. Also make sure you asked for "a PDF file", not "a PDF-style summary".

How good do Claude's PDFs look?

The answer depends on the kind of document. In the sandbox, Claude usually builds PDFs with Python libraries such as ReportLab, or by converting another format. That works well for structured documents like reports, tables, letters and checklists.

For designed layouts (resumes, invoices, brochures, certificates), you get better results when Claude writes HTML and CSS. That's what it's best at, and a browser engine then turns it into the PDF. Ask for that explicitly.

Write a self-contained HTML file for this invoice with inline CSS, @page { size: A4; margin: 15mm }, and break-inside: avoid on table rows. Then render it to PDF.

Create PDFs with Claude Code

Claude Code runs on your machine, so it can use whatever you have installed. Ask it to "turn report.html into a PDF" and it will typically do one of these.

All of these work, but each needs a local browser or system packages, and results vary between machines. Anthropic also publishes Agent Skills, including one for working with PDFs, that give Claude ready-made instructions for these tasks.

Easier: connect a PDF tool to Claude

Connecting a PDF tool gives you consistent, well-designed PDFs with nothing to install. The html-pdf.com MCP server gives Claude two tools, html_to_pdf and url_to_pdf, that render in headless Chromium and return a download link valid for 24 hours.

Claude writes the HTML and Chrome's engine lays it out. Flexbox, grid, web fonts and page numbers come out as they would in Chrome.

Claude.ai and Claude Desktop (custom connector):

  1. Get a free key at https://html-pdf.com/login. It includes 100 credits, and 1 credit = 1 page.
  2. Open Customize → Connectors, click + Add → Add custom connector, name it html-pdf and paste https://html-pdf.com/mcp (then click Connect and log in), or https://html-pdf.com/mcp?api_key=hp_live_....
  3. Turn the connector on for the chat from the tools menu.

For the full walkthrough with Team and Enterprise steps, see the Claude setup guide.

Claude Code (one command):

claude mcp add --transport http html-pdf https://html-pdf.com/mcp \
  --header "Authorization: Bearer $HTML_PDF_KEY"

No key yet? Connect without the header and Claude opens an html-pdf.com login, where new accounts get 100 free credits. See the Claude Code guide for details.

Then ask:

Use html-pdf to make a two-page A4 PDF of this quarterly summary, with a cover title, a styled table and "Page X of Y" in the footer. Set max_pages to 5.

With max_pages, the render fails at no cost if the document runs longer than expected. Claude can check your balance with get_credits, and buy_credits returns a Stripe payment link when you run low.

Prompts that get better PDFs from Claude

Add these instructions to your prompt for cleaner, print-ready output.

How to save a Claude conversation as PDF

You can also save the chat itself rather than a document Claude wrote. Print the conversation from your browser (Ctrl+P or Cmd+P → Save as PDF).

Or ask Claude, "Rewrite this conversation as a clean document with a heading per topic, then render it to PDF."

For developers using the Claude API

In your own app, you can turn Claude's output into a PDF with one request. Have Claude return HTML and send it to the API.

curl -X POST https://html-pdf.com/v1/pdf \
  -H "Authorization: Bearer $HTML_PDF_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Report</h1><p>Generated by Claude.</p>", "format": "A4", "margin": "15mm", "response": "url"}'

The JSON response includes the url (valid 24 hours), the page count and your remaining credits. Your HTML isn't stored.

FAQ

Can Claude create a PDF file?

Yes. Turn on Code execution and file creation in Settings and ask for "a PDF file". For designed layouts, connect the html-pdf.com MCP server so Claude's HTML is rendered in Chromium.

Is there a free way to make PDFs with Claude?

Yes. Claude's built-in file creation can make simple PDFs, and html-pdf.com gives you 100 free credits once, with no card required. One credit is one PDF page.

How do I add page numbers to a PDF made by Claude?

Ask for "Page X of Y in the footer" and leave a bottom margin so the footer has room. With the html-pdf.com tool, Claude uses the pageNumber and totalPages placeholders.

Links from the html-pdf.com tools last 24 hours, and your HTML is not stored. Download the file before the link expires.

More: API docs · MCP server · How to make ChatGPT create a PDF

This page as markdown · text