Skip to content

rposborne/wkhtmltopdf-heroku

Repository files navigation

wkhtmltopdf-heroku

Provides a wkhtmltopdf binary for Heroku Ubuntu 18.04/20.04 LTS environment.

Experimental support for Heroku Stack-22 (Ubuntu 22 with OpenSSL 3.0) is also available via version 2.12.6.1.pre.jammy.

Preconfigures pdfkit, wicked_pdf, and wisepdf to use this binary if they are loaded.

Installation

In your Gemfile:

For Heroku Stack 18/20 (Ubuntu 18.04/20.04 LTS)

  gem 'wkhtmltopdf-heroku', '2.12.6.0'

Experimental support for Heroku Stack-22 (Ubuntu 22.04 LTS Jammy)

  gem 'wkhtmltopdf-heroku', '2.12.6.1.pre.jammy'

Usage

When using with wicked_pdf

Since wicked_pdf overwrites its config hash in the initializer, you will need to update it to make sure its exe_path is configured correctly.

If you don't need any extra configurations, you can simply remove the initializer. Or you can change it to:

WickedPdf.config ||= {}
WickedPdf.config.merge!({
  # your extra configurations here
})

When using with pdf_kit or wisepdf

No extra configuration is needed. But please make sure you are not re-configuring the binary path again in their initializer files.

When using with other gems

You will need to configure the path manually. You can get the path to the executable by using this: Gem.bin_path('wkhtmltopdf-heroku', 'wkhtmltopdf-linux-amd64')

Current wkhtmltopdf binary Version

0.12.6.0 Ubuntu Focal AMD64

0.12.6.1 Ubuntu Jammy AMD64

For more details see CHANGELOG

Supported Heroku Stacks

Contributors

  • @bradphelan
  • @pallymore

Copyright

Copyright (c) 2011 Brad Phelan. See LICENSE.txt for further details.