pycups icon indicating copy to clipboard operation
pycups copied to clipboard

How to get list of all Cups printing options?

Open abtahiishmam3 opened this issue 4 years ago • 1 comments

When I am printing using this module, I want to specify different options such as no of copies, select page no etc. The options are to be passed in a dictionary as far as I know. But, where can I get list of all the options? i found some in various forums but getting a proper list would be a big help.

abtahiishmam3 avatar Jan 29 '21 20:01 abtahiishmam3

When I am printing using this module, I want to specify different options such as no of copies, select page no etc. The options are to be passed in a dictionary as far as I know. But, where can I get list of all the options? i found some in various forums but getting a proper list would be a big help.

You can try the following code

ppdfile = conn.getPPD("printer name") ppd = cups.PPD(ppdfile) groups = ppd.optionGroups for group in groups: for opt in group.options: print(opt.keyword + ":" + opt.defchoice) print(opt.choices)

JackJieMa avatar Nov 16 '22 08:11 JackJieMa