Markdown to PDF API — CommonMark & GFM tables

A README, a generated report, notes from an agent: POST /markdown-to-pdf turns Markdown straight into a styled PDF, with no HTML and no stylesheet to write. CommonMark plus GFM tables and strikethrough, through the same async queue, signed webhooks and Idempotency-Key as every other PDFik endpoint. On every plan, including Free.

Start for Free →Markdown docs

Send Markdown, get a PDF

Submit the source, get a job_id, poll the job or wait for the HMAC-signed webhook, download the file. Headings, tables, code blocks, lists and blockquotes come out with a consistent document theme — the part you would otherwise spend an afternoon writing CSS for.

curl -X POST https://api.pdfik.net/markdown-to-pdf \
  -H "X-API-Key: sk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "# Invoice 2026-09\n\n| Item | Price |\n| --- | --- |\n| Render | $0.01 |\n\n~~draft~~ **final**",
    "options": { "format": "A4", "margin": { "top": "15mm", "bottom": "15mm" } }
  }'

# 202 Accepted
# { "job_id": "0b1f...", "status": "queued", ... }

curl -H "X-API-Key: sk_live_YOUR_KEY" \
  -o invoice.pdf https://api.pdfik.net/jobs/JOB_ID/download

Or from your terminal

The command-line tool speaks the same endpoint, which makes it a one-liner in a CI job or a release script.

# The same thing from the command line - "-" reads stdin
pdfik markdown-to-pdf README.md -f readme.pdf --format Letter --margin 15mm

cat notes.md | pdfik markdown-to-pdf - -o - > notes.pdf

What you control

  • Dialect: CommonMark plus GFM tables and strikethrough. Raw HTML inside the Markdown is escaped, not rendered — that is the contract, and it is what keeps a pasted document from executing anything.
  • Page layout: the same options as /html-to-pdf — paper format, margins, header and footer templates, scale; watermark on Starter+, password and compression on Pro+.
  • Document styling: the built-in print stylesheet. There is no custom-CSS option here on purpose; if you need one, /html-to-pdf gives you full control.
  • Size: up to 100,000 characters of Markdown (422 above it, nothing charged); the converted document must also fit the processing queue, the same bound as HTML jobs.
  • Delivery: on Pro+ the delivery option uploads the PDF straight to your own bucket via a presigned PUT URL — nothing is stored on PDFik's side.

Same quotas, same guarantees

One document consumes one render unit plus its bytes from your plan's monthly quota — a two-page note and a two-hundred-page report count the same. Files are available for 24 hours, then deleted. Test mode (test: true) is free of quota and returns a bundled sample PDF, so CI never burns renders. Rendering runs on AWS in the EU (Frankfurt). Full request and response shapes are in the Markdown reference; plan quotas are on the pricing page.

FAQ

How do I convert Markdown to PDF with an API?

POST your Markdown source to /markdown-to-pdf with your API key. You get a job_id back immediately; poll the job or receive a signed webhook, then download the PDF. There is no HTML and no CSS to write — a built-in print stylesheet handles headings, tables, code blocks, lists and blockquotes.

Which Markdown dialect is supported?

CommonMark, plus the GFM tables and strikethrough extensions. Raw HTML typed inside the Markdown is escaped rather than rendered, so an <img> or <div> appears as literal text — that is the documented contract. If your document needs real HTML or custom CSS, use /html-to-pdf instead.

Can I control the page layout?

Yes. The same options object as /html-to-pdf applies: paper format, margins, header and footer templates, scale, plus watermark on Starter and above and password protection or compression on Pro and above. What you cannot supply is a custom stylesheet for the document body — that is what /html-to-pdf is for.

How long can the Markdown be?

Up to 100,000 characters; longer input is rejected with 422 before anything is charged. The document converted from your Markdown must also fit the processing queue, the same roughly 240 KB bound as /html-to-pdf — a document past it comes back as 413 and the render is not charged, so split it into parts.

What does a Markdown render cost?

There is no separate Markdown price: one document consumes one render unit and its bytes from the same monthly quota as the other endpoints, on every plan including Free. Test mode (test: true) is free of quota and returns a bundled sample PDF.

Where does it run, and how long are files stored?

Rendering runs on AWS in the EU (Frankfurt). Generated files are available for download for 24 hours, then deleted. On Pro and Business plans the delivery option uploads the PDF straight to your own bucket via a presigned PUT URL, and PDFik stores no copy at all.

Create a free account →Read the docs

Full request and error reference: docs.pdfik.net/markdown-to-pdf. Found something outdated? Tell us and we'll fix it.