Skip to content
Projetos

Sobre

Conversor de Markdown para PDF que prioriza a privacidade, funciona offline e é executado inteiramente no navegador.

Segurança e privacidade

Como estes números são medidos

Crescimento medido de estrelas

em 24 h
0
em 7 dias
+5
em 15 dias
+5
em 1 mês
+10

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

CI Verification Deploy GitHub Pages License: MIT

Markdown2PDF (md2pdf)

English | 简体中文(Simplified Chinese) | 繁體中文(Traditional Chinese)

Live Web App: https://realdennis.github.io/md2pdf/

Convert Markdown files to clean PDFs completely offline in your browser—no backend uploads, no account required, and zero third-party tracking of your documents.

md2pdf split-pane Markdown editor and live PDF preview

Why md2pdf? (Privacy-First Architecture)

  • 100% Client-Side Execution: Markdown parsing, syntax highlighting, and print layout run locally in your browser tab.
  • Zero Server Uploads: Your .md resumes, notes, and docs never leave your machine.
  • Live Split-Pane Editing: Resizable CodeMirror editor with GitHub-flavored Markdown preview and inline HTML support.
  • PWA / Offline Ready: Cached static bundle loads cleanly even without an active connection after first visit.
flowchart LR
  A["Local .md File / Editor"] --> B["Browser Parser (Remarkable + highlight.js)"]
  B --> C["Live Styled Preview"]
  C --> D["Browser Print -> Save as PDF"]

Quick Start (Web App)

  1. Open https://realdennis.github.io/md2pdf/ (Chrome recommended).
  2. Click Choose (or drag and drop) to load a local .md file, or edit directly in the left pane.
  3. Drag the center divider to resize the layout if needed.
  4. Click Transform to open the browser print dialog.
  5. Set Destination to Save as PDF and uncheck Headers and Footers (反選頁首與頁尾).

Tips

  • Embed inline styled HTML tags (for example <span style="color:#0984e3">text</span> or <blockquote>) directly in Markdown.
  • Adjust browser margins and background graphics inside Chrome Print settings for custom spacing.

Local Development & Verification

Requires Node.js 20 LTS (or Node 18+/22+) and Yarn 1.x.

Because Webpack 4 ([email protected]) uses legacy OpenSSL hashing on Node 17+, export NODE_OPTIONS=--openssl-legacy-provider before building:

yarn install --frozen-lockfile
CI=true NODE_OPTIONS=--openssl-legacy-provider yarn test --watchAll=false
NODE_OPTIONS=--openssl-legacy-provider yarn build
yarn smoke
  • Start the local dev server: NODE_OPTIONS=--openssl-legacy-provider yarn start
  • yarn smoke verifies relative ./ asset paths in ./build/index.html, serves ./build over localhost HTTP, and renders the app in headless Chrome.

Self-Hosting with Docker

Run a local nginx instance on port 8080:

docker compose up -d
  • Uses a multi-stage node:20-alpine -> nginx:alpine build (with NODE_OPTIONS=--openssl-legacy-provider configured inside Dockerfile).
  • Customize the exposed port in docker-compose.yaml.

MIT License © 2019–present realdennis — see LICENSE.

Explore projetos relacionados

Carregando…