Markdown to PDF

Turn Markdown into a tidy PDF with headings, tables and coloured code, in a choice of page sizes and styles. Converts Markdown to a PDF with real, selectable text. Standard Markdown (CommonMark) with tables, ~~strikethrough~~, task lists and fenced code blocks. Nothing outside the Markdown is ever loaded.

Input

The Markdown to convert.
Paper size.
Empty space around the text on every page, in millimetres.
Size of the body text in points.
Look of the document: clean is sans-serif, serif is a book-like face with justified text, compact fits more on a page.
Title stored in the PDF, shown by viewers in the window title. Defaults to the first heading.
Print "page / pages" at the bottom of every page.
Keep harmless HTML tags written in the Markdown, such as <br>, <sub> and <div style="page-break-after: always">. Scripts, style sheets and frames are always removed. When off, HTML is shown as text.

Result

Choose a file and press Run.

Files you upload and the results are stored for one hour, then deleted. Anyone who has the link can open them, so don't upload anything private.

Use it from code or an agent

curl -s https://setget.net/v1/tools/markdown-to-pdf \
  -H 'Content-Type: application/json' \
  -d '{"input":{"markdown":"# Report\n\nSales rose **12%** this quarter.\n\n| Region | Sales |\n|--------|------:|\n| North | 420 |\n| South | 380 |"},"wait":30}'
import json, urllib.request

body = {'input': {'markdown': '# Report\n\nSales rose **12%** this quarter.\n\n| Region | Sales |\n|--------|------:|\n| North | 420 |\n| South | 380 |'}, 'wait': 30}
request = urllib.request.Request("https://setget.net/v1/tools/markdown-to-pdf", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/markdown-to-pdf", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"markdown":"# Report\n\nSales rose **12%** this quarter.\n\n| Region | Sales |\n|--------|------:|\n| North | 420 |\n| South | 380 |"},"wait":30}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "markdown-to-pdf",
  "input": {
    "markdown": "# Report\n\nSales rose **12%** this quarter.\n\n| Region | Sales |\n|--------|------:|\n| North | 420 |\n| South | 380 |"
  },
  "wait": 30
}
{
  "input": {
    "markdown": "# Report\n\nSales rose **12%** this quarter.\n\n| Region | Sales |\n|--------|------:|\n| North | 420 |\n| South | 380 |"
  },
  "wait": 30
}

This is a file tool, so a call takes three steps: upload the file to get a reference, run the tool with that reference, then read the result and download its files. Uploads and results are public by link and expire after one hour.

Endpoint: POST /v1/tools/markdown-to-pdf. Over MCP: run_tool with slug: "markdown-to-pdf". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
markdown string yes The Markdown to convert.
page_size string no Paper size. One of: A4, Letter, A5, Legal. Default: "A4".
margin integer no Empty space around the text on every page, in millimetres. Default: 20. From 5 to 50.
font_size integer no Size of the body text in points. Default: 11. From 6 to 24.
theme string no Look of the document: clean is sans-serif, serif is a book-like face with justified text, compact fits more on a page. One of: clean, serif, compact. Default: "clean".
title string no Title stored in the PDF, shown by viewers in the window title. Defaults to the first heading. Default: "".
page_numbers boolean no Print "page / pages" at the bottom of every page. Default: false.
allow_html boolean no Keep harmless HTML tags written in the Markdown, such as <br>, <sub> and <div style="page-break-after: always">. Scripts, style sheets and frames are always removed. When off, HTML is shown as text. Default: false.

Examples

A short report on A4

Input
{
  "markdown": "# Report\n\nSales rose **12%** this quarter.\n\n| Region | Sales |\n|--------|------:|\n| North | 420 |\n| South | 380 |"
}
Result

Press the example button above to make it.

US Letter, serif, with page numbers

Input
{
  "markdown": "# Notes\n\n- [x] Draft\n- [ ] Review\n\n```python\nprint(\"hello\")\n```",
  "page_size": "Letter",
  "theme": "serif",
  "font_size": 12,
  "page_numbers": true
}
Result

Press the example button above to make it.

Questions

Which Markdown is supported?
Standard Markdown (CommonMark) with tables, ~~strikethrough~~, task lists and fenced code blocks. Code blocks marked with a language are coloured.
Why is my picture missing?
Pictures are never downloaded, and files cannot be attached to this tool. A picture appears only when it is written into the Markdown itself as a data: address (PNG, JPEG, GIF or WebP). Otherwise its description is printed in its place and the result lists how many were left out.
How do I start a new page?
Turn on "allow_html" and put <div style="page-break-after: always"></div> where the page should end.
Which characters can be printed?
Latin with accents, Greek, Cyrillic and many symbols. Chinese, Japanese, Korean and emoji are not in the fonts on this server and come out as empty boxes.
How long can the document be?
Up to 100,000 characters of Markdown, roughly 60 to 100 pages.

Conversions this tool does