-
Notifications
You must be signed in to change notification settings - Fork 46
Home
cmowforth edited this page Sep 13, 2010
·
8 revisions
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:
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.
You can access the filename, job_id and printer attributes:
pj.filename pj.job_id pj.printer
Or to see how it went:
pj.state pj.completed?
And to cancel:
pj.cancel
Check out the RDoc.