Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markdown to PDF [closed]

Tags:

c#

.net

markdown

Are there any libraries which can convert Markdown to PDF? Or a complete markdown parser which generates tokens instead of HTML directly?

like image 354
jgauffin Avatar asked Apr 04 '12 10:04

jgauffin


People also ask

How do I open a Markdown file as a PDF?

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 .

Can Markdown display 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.

How do I save an atomic file as a PDF?

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.


2 Answers

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.

like image 173
jgauffin Avatar answered Oct 19 '22 17:10

jgauffin


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/

like image 1
Jonathan Avatar answered Oct 19 '22 18:10

Jonathan