PDF from Markdown API - Convert Markdown to Print HTML
Converts Markdown to HTML (headings, bold, italic, code, blockquotes, lists, links, images) then wraps in a full page with @page size rules and baseline print styles. Pass to a headless Chromium instance to produce the final PDF file.
Code examples
curl -X POST https://api.botoi.com/v1/pdf/from-markdown \
-H "Content-Type: application/json" \
-d '{"markdown":"# Quarterly Report\n\n## Summary\n\n- Revenue up 12%\n- New signups: 487\n\nFull details in the [dashboard](https://botoi.com/dashboard).","options":{"format":"A4"}}'When to use this API
Export LLM responses as PDFs
LLM chat responses are typically Markdown. When users click "export as PDF", run the response through this endpoint and pipe to Chromium for the final PDF.
Readme to PDF for documentation packages
Convert README.md files into polished PDFs for proposal and RFP attachments. Your source-of-truth stays as Markdown in Git.
Blog-to-PDF reader feature
Power an "offline reading" feature: users convert blog posts (Markdown-sourced) to PDFs they can save for later.
Frequently asked questions
Which Markdown features are supported?
Headings (# - ###), bold (**text**), italic (*text*), inline code (`code`), blockquotes (> text), unordered lists (- item), ordered lists (1. item), horizontal rules (---), links ([text](url)), images ().
Does it support GitHub-flavored extras?
Not yet. Tables, fenced code blocks with language, task lists, and strikethrough are on the roadmap. For those, convert with a full Markdown engine first, then call /v1/pdf/from-html.
What paper formats are supported?
A4 (default) and letter. Landscape orientation via options.landscape: true.
Are the styles customizable?
The wrapper includes baseline print CSS (margins, typography, code blocks, images). Override via a <style> block in your Markdown if the renderer supports inline HTML.
Why two separate endpoints (from-html and from-markdown)?
from-markdown runs the Markdown → HTML step first, then wraps. from-html skips the conversion. Use from-html when your source is already HTML (CMS export, SSR output).
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.