wkhtmltopdf_binary_gem
wkhtmltopdf_binary_gem copied to clipboard
Windows platforms?
Is there any way we can make this work on Windows?
wkhtmltopdf
has Windows packages. Am I missing something here?
If you can make it work, I'll gladly merge it in. Do you know if they need to run an installer, or if the exe alone is enough?
I had a quick go at this, my theory is that you could just extract the contents of wkhtmltox-0.12.4_msvc2015-win64.exe
into the bin/
folder and then modify the contents of bin/wkhtmltopdf
to match on /mingw32/
However I got stuck with Cygwin path hacks getting in the way with https://github.com/mileszs/wicked_pdf/. wicked_pdf was correctly reporting the executable path of this binary as /cygdrive/c/Ruby/lib/ruby/gems/2.3.0/bin/wkhtmltopdf
, but File.exist?("/cygdrive/c/Ruby/lib/ruby/gems/2.3.0/bin/wkhtmltopdf") == false
.
My Cygwin knowledge isn't strong enough to continue, so a much easier solution with wicked_pdf
on Windows is to just install the Windows package, and set the path manually in config/initializers/wicked_pdf.rb
:
if RbConfig::CONFIG['host_os'].match(/mingw32/)
WickedPdf.config[:exe_path] = 'C:\\program files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe'
end
Is there any way we can make this work on Windows?
wkhtmltopdf
has Windows packages. Am I missing something here?
@m-baumgartner , I'm curious; is your Ruby
application currently on Windows in production or is this request purely for dev purposes?
@unixmonkey I think we can close it 🤝 🍻