Here’s a simple Markdown to PDF converter implemented in Python using the markdown and pdfkit libraries. It reads a .md file and converts it into a .pdf file.
✅ Prerequisites
Install the following packages:
Also install wkhtmltopdf (required by pdfkit):
-
Ubuntu/Debian:
sudo apt install wkhtmltopdf -
macOS (Homebrew):
brew install wkhtmltopdf -
Windows: Download from https://wkhtmltopdf.org/downloads.html
Make sure wkhtmltopdf is in your system’s PATH.
🧾 Python Script: Markdown to PDF
🏁 How to Use
This will convert sample.md to output.pdf using HTML styling for better formatting.
Let me know if you want an interactive GUI version or integration into a web app.
Share this Page your favorite way: Click any app below to share.