What this page is
This is the consolidated home for converting Markdown to PDF on Tigzig. There are a hundred markdown-to-PDF libraries out there - this page is the setup I actually build and run: one approach, exposed as a tool, an API, and an MCP server, all open source, plus the apps it powers. Pick what you need:
Two methods - markdown and ReportLab
I run two markdown-to-PDF engines. Both are open source and FastAPI-based:
- The markdown-library route - a lighter, quick way to turn markdown into a clean PDF. Good when you just want a tidy document fast. Repo: shared-markdown-to-pdf.
- ReportLab (my recommended method) - more control over formatting: tables (standard or side-by-side), code blocks, embedded images, and custom styling. This is what I use for all my backends, and it is what the live tool and the MCP server run on. Repo: shared-reportlab-md-to-pdf.
If you are choosing: start with ReportLab. The markdown-library route is the fast-and-simple alternative when the document is plain.
Use the free web tool
Paste raw Markdown or upload a .md file and download a clean, formatted PDF (plus an HTML version). It renders the full common Markdown set - headings, bold/italic, lists, tables, fenced code blocks, blockquotes, links - as a real, selectable-text PDF, not a screenshot. Images can be embedded. No sign-up, no watermark.
Runs the ReportLab engine. Opens at mdtopdf.tigzig.com.
Use it from your code or an AI agent (API & MCP)
No auth, no key. The same converter is an open HTTP API and an MCP server, so a script - or an AI agent that just generated a report - can turn markdown into a real document.
Base URL https://mdtopdf.tigzig.com; interactive docs at /docs.
JSON body, returns the PDF file directly. (Send a file instead via POST /api/convert, multipart field file.)
curl -X POST https://mdtopdf.tigzig.com/api/convert/text \
-H "Content-Type: application/json" \
-d '{"content": "# My Report\n\nWritten in **markdown**.", "filename": "report.pdf"}' \
--output report.pdfimport requests
r = requests.post(
"https://mdtopdf.tigzig.com/api/convert/text",
json={"content": "# Report\n\nSome **markdown** with a table.", "filename": "report.pdf"},
)
open("report.pdf", "wb").write(r.content)For reports with charts: upload the image to /api/upload-image, then POST to /text-input with the returned image_path - that endpoint returns a hosted pdf_url + html_url to share.
Mount it in Claude, Flowise or n8n; the agent calls a tool with markdown and gets back a PDF URL.
MCP endpoint (Streamable HTTP). Add it as a custom MCP server / tool. Open source, no auth. More on the MCP servers page.
Get the code (open source)
Everything is public - clone and run your own, or read how it works. The backend is one FastAPI service that is both the HTTP API and the MCP server, so it stays a single constant repo whichever way you call it.
- Web tool + HTTP API + MCP (ReportLab, recommended): shared-reportlab-md-to-pdf and the MCP build shared-mcp-markdown-to-pdf.
- The lighter markdown-library route: shared-markdown-to-pdf.
git clone https://github.com/amararun/shared-reportlab-md-to-pdf.git
cd shared-reportlab-md-to-pdf
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000Built on Python ReportLab + FastAPI. Production-hardened (per-IP rate limiting, concurrency caps, error sanitization, Cloudflare WAF). Runs fine on a free tier.
Apps powered by this backend
This is not a demo - the ReportLab backend is the PDF engine behind several Tigzig tools. Every one is open source on github.com/amararun; they all call the same converter:
- AI Technical Analysis report - generates a formatted PDF technical-analysis report (with charts) for any ticker.
- Portfolio Analysis Suite and the Quants Agent - QuantStats + Security Performance + Technical Analysis, with PDF report output.
- Quants GPT - the custom GPT returns its technical-analysis report as a PDF via this backend.
- Database AI Suite (DATS-4) - ask the agent to convert an analysis to PDF and it uses this backend.
- Flowise / n8n agent flows - any flow that mounts the MCP server can hand back a PDF at the end of the run.
Frequently asked questions
Is it free? Yes. No sign-up, no watermark. The API and MCP server are open, no key required.
Which method should I use? ReportLab for anything with tables, code, or images (it is what I use everywhere). The lighter markdown-library route is fine for plain documents.
Does it handle tables and code blocks? Yes - tables, fenced code blocks, lists, blockquotes, and links all render, and images can be embedded.
Can an AI agent use it? Yes - call the HTTP API directly, or mount the MCP server in Claude, Flowise, or n8n and convert as a tool call.
How is the PDF generated? A FastAPI + ReportLab service - real PDF typesetting, not a browser print-to-PDF, so layout is consistent and files are lightweight.
Who built it? Part of Tigzig - a free collection of AI tools for analytics, data, and automation.