rposborne/wkhtmltopdf-heroku

Use locally instead of wkhtmltopdf-binary-edge

Closed this issue · 4 comments

Hi. I was wondering if this would take place of wkhtmltopdf-binary-edge locally as well as configuring wkhtmltopdf for heroku? Do I need both for local and production? Thanks for your time.

Hello, this gem only provides the wkhtmltopdf binary for Ubuntu 14 (64bit)
The wkthmltopdf-binary gem provides binaries for Ubuntu(32bit and 64bit) and Mac OS X.

If you are using 64bit Ubuntu 14 in your development environment, you should be able to use this gem locally. If not, you will need the wkhtmltopdf-binary-edge gem or install wkhtmltopdf in your OS manually (if you are using windows or any other OS that is not supported by the binary-edge gem).

group :development, :test do
  gem "wkhtmltopdf-binary-edge"
end

group :production do
   gem "wkhtmltopdf-heroku"
end

Thanks a ton for the help @pallymore. I am on OSX. So should I be good to just use this then? I'm using wicked_pdf as well. Where exactly does the exe get installed so I can put it in the initializer?:

WickedPdf.config = {
  #:wkhtmltopdf => '/usr/local/bin/wkhtmltopdf',
  #:layout => "pdf.html",
  :exe_path => '/usr/local/bin/wkhtmltopdf'
}

For heroku does it just set that path automatically?

This gem configures WickedPdf automatically.

You should be able to use the wkhtmltopdf-binary-edge in your local environment. The gem provides an executeable wkhtmltopdf program in your gems folder (under bin)

If you use rvm, you should find it in your rvm folder. e.g.:

$ which wkthmltopdf
=> /Users/yzhang/.rvm/gems/ruby-2.1.5/bin/wkhtmltopdf

If your gemdir's bin folder is already included in the $PATH, you don't have to configure the exe_path for WickedPdf.

Awesome. Thanks a ton for the help.