Convert Markdown to Beautiful PDFs
Transform Markdown documents into professionally styled PDFs. Full GitHub Flavored Markdown support with tables, code blocks, task lists, and custom CSS styling.
# Convert Markdown to PDF
curl -X POST \
https://api.convertfilefast.com/v2/convert/markdown-to-pdf \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "# Project Report\n\n## Summary\n\n| Metric | Value |\n|--------|-------|\n| Users | 1,234 |",
"css": "body { font-family: Georgia, serif; line-height: 1.6; }",
"options": {"page_size": "A4"}
}' \
--output report.pdf
# HTTP 200 OK — Content-Type: application/pdfimport requests
markdown_content = """
# Monthly Report
## Key Metrics
| Metric | Value |
|--------|-------|
| Users | 1,234 |
| Revenue | $56K |
"""
response = requests.post(
"https://api.convertfilefast.com/v2/convert/markdown-to-pdf",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"content": markdown_content, "options": {"page_size": "A4"} }
)
with open("report.pdf", "wb") as f:
f.write(response.content)const markdown = `# Monthly Report\n\n## Key Metrics\n| Metric | Value |\n|--------|-------|\n| Users | 1,234 |`;
const response = await fetch(
"https://api.convertfilefast.com/v2/convert/markdown-to-pdf",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ content: markdown, options: { page_size: "A4" } }),
}
);
fs.writeFileSync("report.pdf", Buffer.from(await response.arrayBuffer()));// n8n HTTP Request Node
{
"method": "POST",
"url": "https://api.convertfilefast.com/v2/convert/markdown-to-pdf",
"contentType": "json",
"body": "={{ JSON.stringify({ content: $json.markdown_text, options: { page_size: 'A4' } }) }}",
"options": { "response": { "responseFormat": "file" } }
}Advantages
Why use our API?
Complete and reliable solution for integration in any tech stack.
GitHub Flavored Markdown
Full GFM support: tables, task lists, strikethrough, code blocks with syntax highlighting.
Custom CSS Styling
Apply your own CSS to control fonts, colors, spacing, and layout of the output PDF.
Multiple Input Methods
Send raw Markdown string, upload a .md file, or fetch from URL.
Code Block Rendering
Syntax-highlighted code blocks preserve formatting perfectly in PDF output.
Page Configuration
Set page size, orientation, and margins for professional document output.
Batch Processing
Convert multiple Markdown files in automated workflows with n8n or scripts.
Or call this from Claude, Cursor, or any MCP client
Convert File Fast ships a native Model Context Protocol server. Give this conversion to an AI agent as a single tool call — no HTTP client, no binary handling, per-user API keys.
npx -y convertfilefast-mcpconvert_file({ target_format: "pdf", source_url: "https://example.com/file.md" })Start Converting Markdown to PDF
Get your API key and convert Markdown documents to PDF in seconds. Free plan includes 10 conversions per month.
No credit card. 10 free conversions on Free plan.