How to generate PDF from markdown using pure ruby
10,320
Solution 1
You can use https://github.com/walle/gimli
I made it just for this purpose. Though, I use textile. But gimli supports all formats supported by GitHub-Markup.
Solution 2
Prawn: The Pure Ruby PDF Generation Library
http://www.rubyinside.com/prawn-ruby-pdf-library-987.html
Solution 3
The wkhtmltopdf
gem is also available: http://rubygems.org/gems/wkhtmltopdf
Related videos on Youtube
Author by
Dimas Kotvan
Updated on May 11, 2022Comments
-
Dimas Kotvan about 2 years
I'm currently using Kramdown to generate HTML from Markdown in Ruby. I know that I can generate a latex file using kramdown and convert it to pdf usaing a command line utility. But I want a pure ruby solution.
Is there a way to convert markdown to pdf using only ruby without using command-line utilities?
-
Fredrik Wallgren almost 12 yearsI don't have access to a Windows machine. So I haven't been able to test. What is the problem with running it on Windows?
-
Artem Oboturov almost 12 yearsNot possible to install all the required components via gems. And then one should configure and debug.
-
Ciro Santilli OurBigBook.com about 10 years@FredrikWallgren does it use another backend, or does it have its own?
-
Fredrik Wallgren about 10 years@CiroSantilli It uses github.com/wkhtmltopdf/wkhtmltopdf to generate the PDF from the HTML generated from the markup.