internetee-registry/config/initializers/pdfkit.rb
Matt Farnsworth 647d68b053 config: Allow Operating System portability
try to use system version of wkhtmltopddf if installed
before trying to use the linux build in project bin, which may crash
2015-10-21 15:55:58 +03:00

12 lines
297 B
Ruby

PDFKit.configure do |config|
installed = %x(which wkhtmltopdf).chomp
if installed == "" then
installed = "#{Rails.root}/vendor/bin/wkhtmltopdf"
end
config.wkhtmltopdf = installed
config.default_options = {
page_size: 'A4',
quiet: true
# :print_media_type => true
}
end