Bon::Cups
Constants
CONNECTION_FAILURE_TOKENS = ["looking for printer", "unable to locate", "offline", "not connected", "connection failed"]
STANDARD_JOB_OPTIONS = ["media", "PageSize", "PageRegion", "ppi", "fit-to-page", "fitplot", "scaling", "copies", "number-up", "orientation-requested", "landscape", "page-ranges", "outputorder", "collate", "job-sheets", "job-priority", "job-hold-until", "print-quality", "print-color-mode", "Resolution"]
Standard CUPS job options that are always valid and never appear in the
printer's PPD/lpoptions -l listing.
THERMAL_TOKENS = ["tm-", "tm_", "epson_tm", "receipt", "thermal", "pos", "star", "bixolon", "citizen", "xprinter", "zebra"]
Class methods
build_options(config : Config, pdf : PDF::PageSize, cli_options : Hash(String, String)) : Hash(String, String)
SourceReads the driver-supported option keys and their allowed values from the
printer's PPD via lpoptions -l. Returns nil if the listing is
unavailable (so validation is skipped rather than blocking printing).
lp_command(printer : String, copies : Int32, options : Hash(String, String), document : String) : Array(String)
Sourcequeues
Sourcevalidate_against!(printer : String, options : Hash(String, String), supported : Hash(String, Array(String))) : Nil
SourceVerifies that every configured option is either a standard CUPS job
option or a real driver option with an allowed value. Invalid options are
silently dropped by lp, so failing loudly here prevents settings that
never reach the printer (for example a non-existent quality option).