Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get list of all Cups printing options? #29

Open
abtahiishmam3 opened this issue Jan 29, 2021 · 1 comment
Open

How to get list of all Cups printing options? #29

abtahiishmam3 opened this issue Jan 29, 2021 · 1 comment

Comments

@abtahiishmam3
Copy link

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.

@JackJieMa
Copy link

JackJieMa commented Nov 16, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants