Skip to content

Instantly share code, notes, and snippets.

@jondkinney
Created April 11, 2013 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jondkinney/5359689 to your computer and use it in GitHub Desktop.
Save jondkinney/5359689 to your computer and use it in GitHub Desktop.
# config/initializers/pdfkit.rb
PDFKit.configure do |config|
if Rails.env == 'development'
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
config.root_url = "http://bolstr.dev" # Use only if your external hostname is unavailable on the server.
elsif Rails.env == 'test'
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
config.root_url = "http://bolstr.dev"
else
# this is where it's installed on the server
config.wkhtmltopdf = '/opt/wkhtmltopdf/bin/wkhtmltopdf'
end
# config.default_options = {
# page_size: 'Legal',
# print_media_type: true
# }
# config.root_url = "http://localhost" # Use only if your external hostname is unavailable on the server.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment