Skip to content
Back to Project Archive

MarkPDF

Browser markdown-to-PDF via react-markdown preview and native print export — GFM, syntax highlighting, no server. Not KaTeX, not jsPDF.

MarkPDF Logo
// PROJECT_ID
free-markdown-to-pdf-converter
// AUTHOR
DHAATRIK CHOWDHURY
// SUBJECT
CASE STUDY
// CLASSIFICATION
PUBLIC // OPEN
// TELEMETRY
STATUS: SHIPPED // EXPORT: BROWSER_PRINT // MATH: NOT_SHIPPED
// IMPACT.LOG
// FUCKUP_LOG
RECORDED
[ FUCKUP LOG ]  I described MarkPDF with KaTeX and jsPDF on this site — the repo exports through browser print and has no LaTeX math deps; my real pain was print CSS pagination, not vanished equations.

SYS.STATUS: v1.0.0 shipped — GFM markdown preview, browser print to PDF

MarkPDF turns markdown into styled documents entirely in the browser: split-pane editor, live react-markdown preview with remark-gfm, react-syntax-highlighter for code blocks, and export via the native print dialog (Save as PDF).

This page replaces portfolio copy that wrongly claimed KaTeX, Remark/Rehype pipeline, jsPDF, and version v1.1.0.

What it is (scope)

SurfaceWhat you do there
EditorWrite GFM with toolbar inserts and line numbers
PreviewLive rendered markdown as you type
SettingsTypography, margins (mm), text/background colors, code theme
ExportBrowser print → Save as PDF (enable background graphics, 100% scale)

Stack: React 19.2, TypeScript 5.8, Vite 6, Tailwind CSS 4, react-markdown, remark-gfm, react-syntax-highlighter, Vitest.

MIT licensed. Static dist/ deployable anywhere.

Who I built it for

  • Students and engineers who need PDF hand-ins without Pandoc/MacTeX installs
  • Privacy-conscious writers who refuse cloud upload converters
  • Quick lab reports with code blocks and GFM tables

Not for: LaTeX-heavy academic papers, guaranteed identical PDFs across all browsers, or 80-page thesis exports without browser memory limits.

Fuckups & learnings

  • Wrong stack story on portfolio. KaTeX, jsPDF, Remark/Rehype as primary narrative — stale fiction. Real stack is react-markdown + print CSS.
  • Print CSS pagination hurts. GFM tables and long code fences split awkwardly across pages — browser engine variance, not a missing npm package.
  • Screen preview ≠ print output without separate @media print rules and dialog settings.
  • Version drift. Site said v1.1.0; package.json is 1.0.0.

Honest limitations

LimitationReality
No LaTeX mathKaTeX not in dependencies
Browser-dependent PDFChrome/Firefox/Safari print margins differ
Not PandocNo bibtex, cross-refs, journal templates
Large documentsVery long markdown can stress preview memory
Print settings requiredBackground graphics and scale affect output

Deep-dive transmissions

Read in order for the full story:

  1. Why MarkPDF — browser print export, not jsPDF — origin, scope, portfolio drift
  2. Tech stack — react-markdown, print CSS, syntax highlighting — what I picked and rejected
  3. Free, MIT, and browser-dependent limits — privacy model and honest PDF ceilings

Run it locally

git clone https://github.com/dhaatrik/free-markdown-to-pdf-converter.git
cd free-markdown-to-pdf-converter
npm install
npm run dev

Tests: npm run test — Vitest. CI on push.

Closing transmission

Write markdown. Preview it. Print to PDF. No server, no TeX install, no upload. If you need math or journal layout, MarkPDF will tell you the truth by what it does not ship. Start with why-and-what.