Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

diglactic/heroku-buildpack-wkhtmltopdf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

heroku-buildpack-wkhtmltopdf

Fork of https://github.com/kwrdie/heroku-22-buildpack-wkhtmltopdf. Largely rewritten.

Problem

Heroku's own heroku-community/apt buildpack allows successful installation of wkhtmltopdf through an Aptfile. However, it copies those files to /.apt/usr/local/bin, and does NOT link that directory to PATH, making it less than ideal for portable web apps.

Solution

This is a somewhat unnecessary workaround to download wkhtmltopdf to /app/bin/ (this is what Heroku's build directory ultimately links to, in case you're confused by the source code), and subsequently adds /app/bin/ to PATH the way the gods intended.

This means, running heroku run bash and then wkhtmltopdf will work. Huzzah!

Usage

heroku buildpacks:add diglactic/heroku-buildpack-wkhtmltopdf

You can override the binary URL via an environment variable:

WKHTMLTOPDF_BINARY_URL=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb

When changing this variable, you will need to clear the Heroku build cache by running this command locally:

heroku plugins:install heroku-builds
heroku builds:cache:purge

© 2022 Diglactic, LLC

About

Install wkhtmltopdf and wkhtmltoimage and register it to PATH on heroku-22

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%