How to Create PDF From Markdown
Markdown is the lingua franca of developer documentation, README files, and technical writing — but sharing .md files with non-technical stakeholders rarely works. Converting Markdown to PDF preserves your formatting, code blocks, and tables in a universally readable document. SublimePDF's API accepts raw Markdown or a Markdown file and returns a styled PDF with syntax-highlighted code, proper heading hierarchy, and automatic table of contents.
Follow the step-by-step instructions below, then use the free tool directly — no registration or download required.
Open Tool →How to Create PDF From Markdown — Step by Step
Prepare your Markdown source
Write or export your Markdown content. SublimePDF supports CommonMark and GitHub Flavored Markdown (GFM) including tables, task lists, footnotes, and fenced code blocks with language identifiers.
Send a POST request to the conversion endpoint
POST your Markdown content to /api/v1/markdown-to-pdf. Pass the raw Markdown string in the request body as { "markdown": "# Your content..." } with Content-Type: application/json, or upload a .md file as multipart/form-data.
Configure styling options
Include optional parameters: 'theme' (github, academic, minimal), 'fontSize' (default 12pt), 'codeTheme' (monokai, github-light, dracula), and 'pageSize' (A4, Letter). These control the visual appearance of the rendered PDF.
Enable table of contents generation
Set "toc": true in your request body to auto-generate a clickable table of contents from your heading hierarchy. The TOC respects heading levels h1–h4 and includes page numbers.
Retrieve the generated PDF
The API responds with the PDF binary in the response body (Content-Type: application/pdf) or a download URL if you set "async": true. For large documents, async mode avoids request timeouts.
Pro Tips
- 💡 Use fenced code blocks with language identifiers (```python, ```javascript) to get syntax highlighting in the PDF — unlabeled blocks render as plain monospace text.
- 💡 Front matter (YAML between --- delimiters) is parsed for title, author, and date metadata that appears on the PDF cover page when 'coverPage': true is set.
- 💡 If your Markdown includes relative image paths, switch to absolute URLs or base64-encoded inline images — the API cannot resolve local file paths.
- 💡 For long technical docs, combine the TOC option with page headers showing the current section title using "headerTemplate": "{{section}}" in your request.
Privacy & Security
All processing happens directly in your browser. Your files are never uploaded to any server — they remain on your device throughout the entire process. SublimePDF uses WebAssembly technology for fast, secure, client-side processing.
Works Everywhere
This tool works on any modern browser — Chrome, Firefox, Safari, or Edge — on desktop, tablet, or mobile. No software to install. PDF is an open ISO standard supported by all major platforms.
How to Create PDF From Markdown — FAQ
Which Markdown flavor does SublimePDF support?
Can I use custom CSS with Markdown-to-PDF conversion?
How are images in Markdown handled?
Is there a size limit for Markdown input?
Related Guides
How to Create PDF From Images
Whether you're compiling a photo album, turning whiteboard snapshots into meeting notes, or assembling product images for a catalog, creating a PDF from images gives you a single shareable file with consistent quality. Unlike sending a zip of images, a PDF displays in the correct order in any reader without requiring unzipping. SublimePDF supports batch image-to-PDF creation with layout and quality controls.
How to Create Booklet From PDF
A booklet rearranges PDF pages so that when printed double-sided on standard paper and folded in half, the pages fall in the correct reading order. This is called imposition — a process that transforms sequential page order (1, 2, 3, 4...) into the specific print sheet order needed for folding (e.g., 4, 1, 2, 3 on a single sheet). SublimePDF handles the imposition math, page rotation, and scaling automatically.
How to Create Poster From PDF
Turning a single PDF page into a large-format poster involves splitting it across multiple standard-sized sheets that you print and assemble — a technique called tiling. This is how you create wall-sized charts, architectural plans, conference posters, and event banners using a regular office printer instead of a wide-format plotter. SublimePDF divides your page across Letter or A4 sheets with alignment marks for seamless assembly.