Turn Markdown into a PDF
To turn Markdown into a PDF, send the text to CurlShot in the markdown field of a POST request with format=pdf. It is rendered as a clean, styled page, with headings, lists, tables, links and code blocks laid out for reading, and comes back as a PDF. Leave format out to get an image of the same page instead.
curl -X POST "https://curlshot.com/api/v1/screenshot" \
-H "X-Access-Key: YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown":"# Weekly report\n\n- Visits: 1,204\n- Signups: 38","format":"pdf"}' \
--output report.pdfHow to convert Markdown to PDF in three steps
- 1
Write the document in Markdown, or take the text your app already has.
- 2
Send it in a POST request in the markdown field, with format set to pdf.
- 3
Save the PDF that comes back.
What the Markdown can contain
The Markdown is turned into a page with a neutral document style: dark text on white, a centred column, styled tables and code blocks. Then it is rendered like any page, as a PDF or an image.
Show the table (6 rows)
| Markdown | Rendered |
|---|---|
| # Headings, **bold**, _italic_, links | Yes |
| Lists and task lists (- [ ] and - [x]) | Yes |
| Tables with | pipes | | Yes, styled |
| Fenced code blocks | Yes, in a monospace block |
| Quotes | Yes |
| Images | Yes, from a full https:// address |
- Change the look with styles: your own CSS for fonts, colours and spacing.
- All PDF options apply: paper size, margins, landscape, one long page.
- Leave format out for a PNG of the same document, and set viewport_width for its width.
- Markdown can be up to 2 MB, sent in a POST body.

What people use it for
- Notes, READMEs and changelogs as a PDF to send
- Reports written by a script or an AI assistant, as a document
- Release notes as an image for a post
- Meeting notes and summaries people can print
For developers: one request
The same thing from your own code. It is a plain HTTP request, so it works from any language. Create a free account to get an access key.
Questions people ask
How do I convert Markdown to PDF?
Send the Markdown to CurlShot in the markdown field of a POST request and add format=pdf. The answer is the PDF file.
Can I change how it looks?
Yes. The styles option adds your own CSS to the page, so fonts, colors and spacing can match your brand.
Can I get an image instead of a PDF?
Yes. Leave format out for a PNG, or ask for jpeg or webp. Set viewport_width to choose how wide the page is.
Are tables and code blocks supported?
Yes. Tables, fenced code blocks, lists, links, quotes and images are all rendered.
Guides that go deeper
- ReferenceWeb page to PDF: paper sizes, margins, print CSSPaper sizes in millimetres, inches, CSS pixels and points, how margins and page breaks work in a PDF of a web page, and the print CSS that controls them.
- Recipe cardInvoice PDF from HTML: a recipe cardAn invoice from HTML to an A4 PDF in one request: the HTML, the call, and a test of 41 invoices that shows which print CSS rules matter.
- Annotated requestA Markdown to PDF request, read line by lineOne Markdown-to-PDF request, read line by line, with what each line does to the PDF: title, margins, code width, tables, links, footnotes, page breaks.
Related tools
- HTML to PDFAn HTML to PDF API: POST your HTML and CSS, get a PDF back. A4, Letter and 9 other paper sizes, margins, page breaks. Node, Python, PHP, cURL. Free plan.
- HTML to imageRender your own HTML, CSS or Markdown into an image or a PDF with one API request. For social cards, certificates, receipts and reports.
- Screenshot APIA screenshot API for developers. One HTTP request turns a URL, HTML or Markdown into a PNG, JPEG, WebP or PDF. Full page, devices, blocking, cache, MCP.