Lorraine
Lorraine

Reputation: 486

generate PDF from html document in Rails

anyone knows about some gem or app in rails to create pdf docs from html5 and css3 with some client side programming??

Thanks ;)

Thank you for your responses. I need this for a possible project wich will use jquery for box positioning and then, will export the resultant html to pdf. Roughly, ¿is this possible?

Upvotes: 1

Views: 3794

Answers (3)

Subhash
Subhash

Reputation: 3260

PDFKit and WickedPDF for Client side generation, as suggested by Raphael and jcadam

Flying Saucer with JRuby: http://xhtmlrenderer.java.net

Personally, I got more accomplished by using Prawn PDF generator. It's capabilities are much more extensive, IMHO.

Prawn for Ruby PDF generation: https://github.com/prawnpdf/prawn

Upvotes: 6

James Adam
James Adam

Reputation: 2324

WickedPDF: https://github.com/mileszs/wicked_pdf

I'm using it now and rather like it:

"Wicked PDF uses the shell utility wkhtmltopdf to serve a PDF file to a user from HTML. In other words, rather than dealing with a PDF generation DSL of some sort, you simply write an HTML view as you would normally, then let Wicked take care of the hard stuff."

If you need more control, also check out Prawn: https://github.com/prawnpdf/prawn. Though Prawn is not an HTML -> PDF converter and is more useful for creating PDFs from scratch.

I'm using both Prawn and WickedPDF on my current project: WickedPDF to generate 'printable' versions of web pages, and Prawn for generating detailed PDF reports.

Upvotes: 2

wyclin
wyclin

Reputation: 522

I believe the PDFKit gem may be what you're looking for. https://github.com/pdfkit/PDFKit

There's also IMGKit if you want images instead of PDFs. https://github.com/csquared/IMGKit

Upvotes: 1

Related Questions