Permalink
Browse files

using current xvfb env if available

  • Loading branch information...
1 parent 7d644ae commit ebbe00787271da2e5d96a85670efff102919a297 @rodrigues rodrigues committed Mar 14, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/wicked_pdf.rb
View
@@ -36,7 +36,8 @@ def pdf_from_string(string, options={})
string_file.write(string)
string_file.close
generated_pdf_file = WickedPdfTempfile.new("wicked_pdf_generated_file.pdf", temp_path)
- command = "DISPLAY=:0 \"#{@exe_path}\" #{'-q ' unless on_windows?}#{parse_options(options)} \"file:///#{string_file.path}\" \"#{generated_pdf_file.path}\" " # -q for no errors on stdout
+ display = ENV['DISPLAY'] || ':0'
+ command = "DISPLAY=#{display} \"#{@exe_path}\" #{'-q ' unless on_windows?}#{parse_options(options)} \"file:///#{string_file.path}\" \"#{generated_pdf_file.path}\" " # -q for no errors on stdout
print_command(command) if in_development_mode?
err = Open3.popen3(command) do |stdin, stdout, stderr|
stderr.read

0 comments on commit ebbe007

Please sign in to comment.