Search code examples
htmlruby-on-railsrubypdfkit

PDFKit usage Rails 5


I have managed installing PDFKit and wkhtmltopdf on Windows 10 for using with Rails 5.

But I can't find any relevant exemple on how to render a html.erb file to PDF.

I took a look on this : pdfkit Usage and it works to save any website to PDF.

I have a <div> that I want to render to PDF.


Solution

  • I recommend you to use Wicked_pdf gem to generate quick and easy pdfs on rails. Here are some examples for both wicked pdf and pdfkit.