0.0
The project is in a healthy, maintained state
This gem is built to convert HTML document into PDFs. There are lots of tools out there that do this. This one uses Selenium+Chromedriver to render the HTML and generate the PDF.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

HTML2PDFChrome

This gem provides a tool for converting HTML documents to PDFs.

There are a lof of tools out there that do this. This one uses Chromedriver to render the HTML and convert it to a PDF. It uses Selenium to fire up Chromedriver.

Installation

This gem can be installed with rubygems:

gem "html2pdf_chrome"

You will, of course, also need a working Google Chrome and Chromedriver installation. Chromedriver can be downloaded from Google or it can be installed via homebrew.

Usage

Once everything is installed using it is pretty easy:

require "html2pdf_chrome"
my_html = "<p>This PDF just has this paragraph</p>"
pdf_data = HTML2PDFChrome.convert_html_to_pdf(my_html)
File.write("my_pdf.pdf", pdf_data)