0

I'm running Rails on Windows and installed wkhtmltopdf(path - C:\Users\User\local\bin). I'm trying to configure it using documentation - https://github.com/pdfkit/pdfkit#configuration. But it gives me errors about path.

I create pdfkit.rb file in initializers folder and wrote this:

PDFKit.configure do |config|
  config.wkhtmltopdf = "C:Users/User/local/bin"
  config.default_options = {
 :page_size => 'Legal',
 :print_media_type => true
 }
end

but it gives me error

    No wkhtmltopdf executable found at C:Users/User/local/bin
    >> Please install wkhtmltopdf - https://github.com/jdpace/PDFKit/wiki/Installing-WKHTMLTOPDF
MID
  • 1,815
  • 4
  • 29
  • 40

1 Answers1

1

You need to specify the whole executable path and put a slash after C:

The path should look like: C:/Users/User/local/bin/wkhtmltopdf.exe consider also that you may use backslash \ instead of slash / in Windows

Francesco Belladonna
  • 11,361
  • 12
  • 77
  • 147