Sufyan Jami
cd ..
~/projects/mdtopdf$

Markdown to PDF

Load or paste Markdown, edit it in the browser, and export a clean PDF with no browser print headers or footers. Renders GitHub Flavored Markdown and sanitizes the HTML before preview. No backend and no upload path, so files stay local to the browser session.

~/built-with$
[react][typescript][tailwind css 4][vite][pdfmake]
~/why$

Why I built this

I wanted a fast, local way to turn Markdown into a properly formatted PDF, entirely in the browser. Building it let me work with the unified, remark, and rehype pipeline and convert a Markdown AST directly into a pdfmake document definition, so the PDF is typeset from the document structure itself.

~/features$

Features

  • Load .md and .markdown files
  • Edit Markdown in the browser
  • GitHub Flavored Markdown rendering
  • Sanitized HTML preview
  • Export to PDF with no print headers or footers
  • Files stay local to the browser session
~/highlights$

Technical highlights

  • unified + remark parse Markdown to an AST
  • rehype sanitizes and serializes the preview HTML
  • Markdown AST converted into a pdfmake document definition
  • No backend, no upload path
  • Tailwind CSS 4 with local reusable UI primitives