How I Built a Markdown to PDF, DOCX and HTML Converter with Flask
As someone who regularly works with Markdown, I kept running into the same problem. Writing content in Markdown is easy. Turning it into a polished PDF or DOCX that I could share with someone else was often not. Most
As someone who regularly works with Markdown, I kept running into the same problem.
Writing content in Markdown is easy.
Turning it into a polished PDF or DOCX that I could share with someone else was often not.
Most of the existing solutions are either:
Command-line focused
Require multiple tools
Need template configuration
Or expect the user to install software locally
I wanted something simpler:
Paste Markdown β Preview β Export.
So I decided to build my own solution.
The Goal
The initial goal was straightforward:
- Browser-based Markdown editor
- Live preview
- Export to PDF
- Export to DOCX
- Export to HTML
- No signup required
As I started building, I also added:
- Multiple document themes
- Table styling options
- Batch conversion support
- Better handling of larger documents
- Why Not Just Use Pandoc?
This is probably the most common question.
Pandoc is an excellent tool and I have a lot of respect for it.
My goal wasn't to replace Pandoc.
The goal was to create a workflow that feels approachable for users who don't want to work with command-line tools, templates, or configuration files every time they need a document.
For many users, convenience matters as much as raw power.
Tech Stack
The application is built using:
- Python
- Flask
- HTML/CSS/JavaScript
For the frontend, I focused heavily on creating a clean and responsive interface rather than exposing every possible setting.
Challenges
A few things turned out to be more difficult than expected:
- PDF Consistency
Getting PDFs to render consistently across different document types was harder than expected.
Tables, code blocks, images, and page breaks all introduce edge cases.
- DOCX Formatting
Users expect Word documents to look professional.
That means:
- Proper heading styles
- Table formatting
- Spacing
- Consistent typography
Small details matter a lot.
- Theme Customization
What started as a simple export feature gradually turned into a theming system.
Users wanted different visual styles depending on whether they were generating:
- Reports
- Documentation
- Notes
- Client-facing documents
- Deployment Lessons
This project also became a learning experience in areas outside development:
- Docker
- DNS configuration
- Custom domains
- SSL certificates
- vercel deployment
- Google Analytics
- Search Console
- SEO
Building the application was only part of the work.
Getting it online and maintaining it turned out to be a project of its own.
What I'm Working On Next
Some improvements currently on my roadmap:
- Better PDF rendering
- More themes
- Custom branding options
- Improved table handling
- Obsidian compatibility
- Better export customization
- Looking for Feedback
The application is live here:
If you regularly work with Markdown, I'd love to hear:
What export workflow do you currently use?
What breaks most often?
What features would make a tool like this useful to you?
Constructive feedback is always welcome.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.