26

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?

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Dimas Kotvan
  • 723
  • 1
  • 7
  • 10

4 Answers4

22

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.

6

Prawn: The Pure Ruby PDF Generation Library
http://www.rubyinside.com/prawn-ruby-pdf-library-987.html

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
2

The wkhtmltopdf gem is also available: http://rubygems.org/gems/wkhtmltopdf

ThomasW
  • 16,981
  • 4
  • 79
  • 106
-2

Pandoc is a universal document converter which can convert documents in markdown, reStructuredText, textile, HTML, DocBook, or LaTeX to HTML, EPUB, Microsoft Word, TeX, PDF via LaTeX, Lightweight markup formats.

You can find it here. http://johnmacfarlane.net/pandoc/

yjc801
  • 5
  • 3