lib/zebra/print_job.rb in zebra-zpl-1.0.2 vs lib/zebra/print_job.rb in zebra-zpl-1.0.5
- old
+ new
@@ -27,9 +27,10 @@
# raise UnknownPrinter.new(printer) unless existent_printers.include?(printer)
# end
def send_to_printer(path)
puts "* * * * * * * * * * * * Sending file to printer #{@printer} at #{@remote_ip} * * * * * * * * * * "
- `lp -h #{@remote_ip} -d #{@printer} -o raw #{path}`
+ result = system("rlpr -H #{@remote_ip} -P #{@printer} -o #{path} 2>&1") # try printing to LPD on windows machine first
+ system("lp -h #{@remote_ip} -d #{@printer} -o raw #{path}") if !result # print to unix (CUPS) if rlpr failed
end
end
end