PDFtoMD
About the Project & Problem Solved
PDFtoMD (https://pdftomd.app/) is a local-first, privacy-by-default web utility that converts text-based PDFs into clean, structured Markdown (GFM).
Copying text from a PDF into note-taking tools like Obsidian or Notion usually results in broken paragraph wrapping, lost heading structures, and mangled lists. At the same time, developers building RAG (Retrieval-Augmented Generation) pipelines struggle with flat, unstructured plain text extraction. Traditional online converters solve this, but they force you to upload sensitive files (contracts, research papers, notes) to remote servers.
PDFtoMD processes everything locally. Your documents never leave your device.
How I Made It
Initially, the plan was to run a heavy Python-based document parser on a remote server. However, running backend servers meant ongoing maintenance costs—which would force me to introduce paywalls or usage caps—and, more importantly, compromised absolute user privacy.
To resolve both challenges, I shifted to a client-side architecture. I utilized WebAssembly (WASM) to run the document parsing logic entirely inside the browser's sandbox. The local algorithm analyzes character coordinates, font metrics, and relative spacing on your local CPU to reconstruct Markdown headings (#), lists, and bold text.
To prevent the heavy WASM binary from harming our Google Core Web Vitals (LCP/INP) and PageSpeed score, I implemented a lazy-loading strategy. The WASM is only fetched and compiled on-demand when a user actually drops a file or clicks the sample test button, keeping the initial static landing page incredibly lightweight and fast.
The Stack
Frontend Framework: Next.js 14 (configured with output: 'export' for full static export) hosted on Cloudflare Pages for $0 serverless hosting.
Styling: Tailwind CSS (fully responsive Light & Dark modes styled with a clean, high-contrast tech aesthetic).
Internationalization: next-intl (pre-configured with structured en and zh local directories).
Core Engine: WebAssembly (WASM) for secure client-side execution.
Monorepo & Package Management: pnpm workspaces (keeping apps and packages strictly decoupled for future scalability).
