-
Notifications
You must be signed in to change notification settings - Fork 58
Home
cmowforth edited this page Sep 13, 2010
·
8 revisions
Ruby wrapper for the common UNIX printing system API.
I’ve found what I’ve developed so far to compile and run on OS X 10.5 with Ruby 1.9.0. YMMV.
A few singleton methods:
require "cups"
Cups.default_printer
Cups.show_destinations
Cups.jobs_on(printer)
Cups.options_for(printer)
To actually print things, we have a PrintJob class:
require "cups"
pj = Cups::PrintJob.new("/path/to/file")
pj.print
The PrintJob object will choose the default printer if you don’t supply a second argument on creation.