0

I would like to print my "test.html.erb" page to pdf format.

Please suggest me the other gems like pdf kit which generates the pdf file from html page.

Ashwini
  • 2,449
  • 2
  • 29
  • 42
  • 3
    https://www.ruby-toolbox.com/categories/pdf_generation – or google for "pdfkit gem alternatives" – Beat Richartz May 14 '13 at 11:58
  • Ruby toolbox, as suggested, is THE resource to find alternatives. WickedPDF is one. – Kashyap May 14 '13 at 12:02
  • Thank you so much. There is some javascript on my html page, which is filling data in HTML tags. using pdfkit am unable to do that. It is only printing HTML without data. – Ashwini May 14 '13 at 12:11
  • make sure you are generating [valid html](http://validator.w3.org/) – fotanus May 14 '13 at 12:29

1 Answers1

1

We have used wicked_pdf with success for quite complicated pages. wicked_pdf allows you to create pdf specific templates (pdf.erb), that can be different from your regulat html templates (there are elements that are meaningless in PDF, such as navigation links).

wicked_pdf use wkhtmltopdf under the hood.

Martin
  • 7,634
  • 1
  • 20
  • 23