« Return to Thread: $stdout to printer

Re: $stdout to printer

by Brian Candler :: Rate this Message:

Reply to Author | View in Thread

All this assumes you can open a channel to your printer from Ruby.
Options you could try, as I'm afraid I don't have a Windows box with a
printer:

(1) File.open("prn:","w") { |f| ... }

(2) IO.popen("print","w") { |f| ... }

(or whatever the command-line tool is for printing a file)

(3) Write the report to a file, then you *must* be able to print it
somehow.

  system("print out.txt")
  system("type out.txt >prn")
  ... ?
--
Posted via http://www.ruby-forum.com/.

 « Return to Thread: $stdout to printer