Generating PDFs From HTML With Rails

Internally, PDFKit uses wkhtmltopdf (WebKit HTML to PDF), an engine that will take HTML and CSS, render it using WebKit, and output it as a PDF with high quality.

To start, install wkhtmltopdf on your computer. You can download the binary or install from Brew on Mac, or your preferred Linux repository.

You also need to install the pdfkit gem, and then run the following bit of Ruby to generate a PDF with the text “Hello Envato!”


Generating PDFs From HTML With Rails #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/generating-pdfs-from-html-with-rails

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles