Are there any libraries which can convert Markdown to PDF? Or a complete markdown parser which generates tokens instead of HTML directly?
Just paste your Markdown content into the editor on the left and see the ( html ) preview on the right. Then click Export as on the top and chose pdf .
Markdown itself doesn't have a mechanism for embedding a PDF. However, Markdown accepts raw HTML in its input and passes it through unaltered.
Open Atom, open the Markdown file that you want to convert, and open the formatted preview ( Ctrl + Shift + M ). Right click on the formatted preview and click on “Open in Browser”. Right click on the browser page and click on “Print…” Change the Destination to “Save as PDF”, then click Save/Print.
I first generated HTML using MarkdownSharp and then PDF using https://wkhtmltopdf.org/
.
Any other answer which links to a token based parser or a library which could generate PDF directly will be awarded the answer.
You might want to check for LaTeX extensions for your markdown parser, which can easily be converted into PDF. There apparently is for the python-markdown parser. For example, https://github.com/justinvh/Markdown-LaTeX.
It also looks like you can use pandoc to convert markdown to LaTeX: https://pandoc.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With