Markdown to PDF API

Convert Markdown to a clean A4 / A5 / Letter PDF: headings, bold / italic, links, nested lists, quotes, code blocks, tables, page numbers, full Vietnamese support.

POSThttps://apibox.io.vn/v1/md-pdf

The Markdown to PDF API turns GitHub-flavoured Markdown into a print-ready PDF without a browser. It renders headings with rules, paragraphs with bold, *italic*, inline code and clickable links, ordered, unordered and task lists (nested), blockquotes, fenced code blocks on a tinted background, tables with column alignment and widths based on their content, and horizontal rules. Long content flows over several pages with page numbers and an optional title in the footer.

Text uses Be Vietnam Pro, embedded as a subset, so Vietnamese renders perfectly and files stay small. Choose the page size (a4, a5, letter), the base font_size and the margin; format=json returns the PDF as base64 with the page count.

Images in the Markdown are replaced by their alt text, and raw HTML is reduced to its text. For styled documents such as quotes and receipts, see the invoice PDF API.

Parameters

NameInTypeRequiredDefault
markdownbodystringyesMarkdown text (max 500,000 characters).
titlebodystringnoDocument title (metadata, footer).
pagebodystringnoa4a4, a5 or letter.
font_sizebodynumberno10.5Base font size (8–16 pt).
marginbodynumberno54Page margin in pt (20–100).
formatbodystringnopdfpdf or json (base64).

Example

curl -X POST "https://apibox.io.vn/v1/md-pdf" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"markdown":"# Hướng dẫn\n\n**Bước 1:** tạo API key.\n\n| Ngân hàng | Mã |\n|---|---|\n| Vietcombank | VCB |","title":"Hướng dẫn"}' \
  -o output

Response

binary application/pdf

Use cases

  • Export documentation, notes and reports as PDF
  • Generate contracts and policies from Markdown templates
  • PDF downloads of knowledge-base articles
  • Printable meeting minutes from chat tools

FAQ

Is a browser used?

No, the PDF is built directly, which is fast and cheap; complex HTML / CSS layouts are therefore not supported.

Are images included?

Not yet: they are replaced by their alt text.

Are links clickable?

Yes, http(s) and mailto links become link annotations in the PDF.

Related APIs

Start with 1,000 free requests every month. Get free API key →