Markdown to PDF With Mermaid Diagrams, Drawn and Sharp
November 11, 2026by TypeFire
markdown to pdf mermaidmermaid to pdfmarkdown pdf with diagramsmd to pdfmarkdown to pdfexport mermaid diagram pdfconvert md file to pdf
You've written a design doc in Markdown with three Mermaid diagrams in it. It reads well in your editor. Then you convert it to PDF to send it, and the diagrams come out as blocks of code.
That's because most converters see a code block and print it. To get the diagrams, you need a tool that draws Mermaid before it writes the PDF.
The short version
- In your browser, free: open the file in TypeFire’s Markdown to PDF editor, then File, Download, PDF.
- Diagrams are drawn into the PDF, tables keep their rows together, pages are numbered.
- On a Mac, TypeFire exports any note as PDF, Word or HTML with its diagrams.
- Getting code instead of a picture? The converter isn’t drawing Mermaid.
The free way, in your browser
- Open the free Markdown to PDF editor, then drop your .md file on the page, or paste the text.
- Check the diagrams drew. Click one to fix a line if something's off.
- Choose File, then Download, then PDF. The file saves in one click, with no print dialog.
What comes through
| In your Markdown | In the PDF |
|---|---|
| Mermaid diagrams | Drawn |
| Headings, bold, italic, links | Kept |
| Lists and task lists | Kept |
| Tables | Kept, a row is never split, the header repeats on each page |
| Code blocks and quotes | Kept |
| Pages | Numbered, Letter in the US and Canada, A4 elsewhere |
The PDF is made in your browser. Nothing is uploaded.
On a Mac, from your notes
If the document is a note in TypeFire, export it straight from the note: PDF, Word or HTML, with every diagram and any math included. You can also copy a single diagram as an image, or open it full window and save it as SVG or PNG.
Other ways, and what to watch for
- Command-line tools. Converters like Pandoc print a mermaid block as code unless you add a Mermaid filter, which needs extra software installed.
- Print to PDF from a preview. Works if the preview draws Mermaid, but wide diagrams can be cut at the page edge and the print dialog adds steps.
- Screenshots pasted into a doc. Works once, then the diagram and the file drift apart.
Tips for a clean PDF
- Keep wide diagrams top to bottom. A
TDflowchart fits a page better than a longLRone. More fixes in making Mermaid diagrams readable. - Put a heading above each diagram so it doesn't end up alone at the bottom of a page.
Ready? Open the Markdown to PDF editor. For diagrams inside your own notes, see diagrams in TypeFire.
Loved by people who type all day.
Unprompted reactions from users, in their own words.
Used by people at
Company names are places where our users work. They do not imply endorsement or affiliation.