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 do it, 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 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.
Related tools
- HTML to PDFConvert your own HTML and CSS into a PDF with one API request. Paper size, margins, landscape and backgrounds are options. For invoices and reports.
- 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.