Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows platforms? #28

Open
m-baumgartner opened this issue Jul 9, 2015 · 4 comments
Open

Windows platforms? #28

m-baumgartner opened this issue Jul 9, 2015 · 4 comments

Comments

@m-baumgartner
Copy link

Is there any way we can make this work on Windows?
wkhtmltopdf has Windows packages. Am I missing something here?

@unixmonkey
Copy link
Collaborator

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?

@soundasleep
Copy link

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

@webaholik
Copy link

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?

@pedrofurtado
Copy link
Contributor

pedrofurtado commented Jul 23, 2021

@unixmonkey I think we can close it 🤝 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants