Created
February 16, 2009 15:31
-
-
Save m0wfo/65205 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "cups" | |
# Create new print job. Specify local file path and printer/class | |
pj = PrintJob.new("/Users/chris/Documents/hash_server.rb", "EPSON_Stylus_Pro_4800") | |
pj.print | |
# New: | |
pj.cancel # => true if print has been called, otherwise false | |
pj.job_id # => @job_id || nil | |
# Returns an array of available printers | |
PrintJob.show_destinations # => ["EPSON_Stylus_Pro_4800", "PDF_Printer", "Epson_AL_M2000_PostScript_"] | |
# Returns default printer string, or false if none specified | |
p PrintJob.default_printer # => "default" || false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment