A beautiful, modern web app to convert Markdown to high-quality PDF documents
- 🎨 Real-time Preview - See your formatted document as you type
- 📝 GitHub-Flavored Markdown - Full GFM support with beautiful styling
- 🎯 Syntax Highlighting - Code blocks with automatic language detection
- 📄 High-Quality PDF Export - Crystal-clear text and sharp rendering (300 DPI)
- 💾 Auto-Save - Your work is automatically saved to browser storage
- 🎭 Clean UI - Modern, intuitive interface inspired by GitHub
- 📱 Responsive Design - Works seamlessly on desktop and mobile
- 🚀 Fast & Lightweight - Built with Vite for optimal performance
- 🔒 Privacy First - All processing happens in your browser, no server uploads
- Node.js (v18 or higher)
- pnpm (recommended) or npm
-
Clone the repository
git clone https://github.com/mirkobertone/md2pdf.git cd md2pdf -
Install dependencies
pnpm install # or npm install -
Start the development server
pnpm dev # or npm run dev -
Open your browser
Navigate to
http://localhost:5173and start converting! 🎉
pnpm build
# or
npm run buildThe optimized production build will be generated in the dist/ directory.
pnpm preview
# or
npm run preview- Frontend Framework: React 19 with TypeScript
- Build Tool: Vite
- Markdown Parser: Marked
- Syntax Highlighting: Highlight.js
- PDF Generation: html2pdf.js
- Styling: GitHub Markdown CSS + Custom CSS
- Code Quality: ESLint + TypeScript
- Write/Paste Markdown - Type or paste your markdown content in the left editor panel
- Preview - See the formatted output in real-time on the right panel
- Export - Click "Download PDF" to generate your high-quality PDF document
MD2PDF supports all GitHub-Flavored Markdown features:
- ✅ Headings (H1-H6)
- ✅ Bold, italic, and strikethrough text
- ✅ Lists (ordered and unordered)
- ✅ Code blocks with syntax highlighting
- ✅ Inline code
- ✅ Tables
- ✅ Blockquotes
- ✅ Horizontal rules
- ✅ Links and images
- ✅ Task lists
- ✅ HTML elements
# Welcome to MD2PDF
## Features
- **Real-time preview**
- Syntax highlighting
- Beautiful GitHub styling
## Code Example
```javascript
function convertToPDF() {
console.log("Converting markdown to PDF!");
return "success";
}
```
## Table
| Feature | Status |
| ---------------- | ------ |
| Markdown parsing | ✅ |
| PDF export | ✅ |The main stylesheet is located at src/App.css. You can customize:
- Colors and theme
- Font sizes and families
- Layout and spacing
- PDF preview styling
PDF generation settings can be adjusted in src/App.tsx in the handleDownloadPDF function:
const opt = {
margin: [15, 15, 15, 15], // Page margins
image: { type: "jpeg", quality: 0.98 }, // Image quality
html2canvas: {
scale: 2, // Higher = better quality, larger file
dpi: 300, // Print quality DPI
},
// ... more options
};Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style
- Write clear, descriptive commit messages
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Marked.js - Markdown parser
- Highlight.js - Syntax highlighting
- html2pdf.js - PDF generation
- GitHub Primer CSS - Design inspiration
- React - UI framework
Have questions or feedback? Feel free to:
- Open an issue on GitHub
- Reach out via email: [email protected]
