An offline web app to convert Markdown to PDF. Runs locally and does not depend on external services.
- ✅ Fully offline
- ✅ Live Markdown preview
- ✅ PDF export without the print dialog
- ✅ GitHub-style look
- ✅ Keyboard shortcuts (Ctrl+S, Ctrl+P)
- ✅ Drag & drop support for .md files
- ✅ Custom filename input
- ✅ Animated drag & drop overlay with visual feedback
- Start the local server:
python3 local.py --port 8000- Open in your browser:
http://localhost:8000/
- Open .md — load a Markdown file from your computer
- Save .md — save the current text as a
.mdfile - Save as PDF — generate and download a PDF
- Drag a
.mdfile anywhere on the page to load it instantly - The overlay will appear with visual feedback when dragging
- Enter a custom filename in the input field before saving
- The extension (
.mdor.pdf) will be added automatically
- Vanilla JavaScript
- Marked.js for Markdown rendering
- html2pdf.js for PDF generation
- DOMPurify for sanitization
POST /api/convert - Convert Markdown to PDF
The API accepts Markdown content and returns a PDF file. It supports CORS and can be called from any origin.
- JSON: Send
{"markdown": "...", "filename": "..."} - File Upload: Upload a
.mdfile via multipart/form-data - Plain Text: Send Markdown as text/plain
curl -X POST http://localhost:8000/api/convert \
-H "Content-Type: application/json" \
-d '{"markdown": "# Hello\n\nWorld", "filename": "test"}' \
--output output.pdfSee API.md for complete API documentation.
To use the API features, install dependencies:
pip install -r requirements.txtThe API requires:
markdown- Markdown parsingweasyprint- PDF generation