Answered by:
How to get extended constraint info in V4 printer extension?

Question
-
Hello,
I noted that the standard desktop Printing Preferences dialog knows somehow what options are constrained when it shows its "Incompatible Print Settings" dialog:
Note that it shows both conflicting options - "Pages Per Sheet: 1" and "Page Border: On".
How can I get the same information in my custom Printer Extension?
Currently I can only determine if an option conflicts with something via "constrained" attribute of an Option tag in PrintCapabilities document, but I can't determine exactly what other option it conflicts with, like the standard desktop UI does.
Is it possible to get this information in Printer Extension by any means? Maybe there is a way to get access to PPD/GPD to get this information from there, or something?
Wednesday, April 18, 2012 6:11 AM
Answers
-
Kondakovdmitry,
In most cases, the constrained attribute is specified on all of the options that caused the invalid combination (a bad constraint JS file might mess this up). This is the best tactic I can recommend for printer extensions to determine how the current PrintTicket is constrained.
We do not support obtaining the GPD/PPD files directly from a printer extension. First, this breaks all the layering and makes you much more susceptible to regressions in the future, and second, enhanced Point and Print makes finding the GPD/PPD file rather tricky for non-Windows consumers.
Thanks!
Justin
- Proposed as answer by Justin Hutchings [MSFT] Monday, April 23, 2012 5:33 PM
- Marked as answer by kondakovdmitry Wednesday, April 25, 2012 3:36 AM
Monday, April 23, 2012 5:33 PM -
Hi Kondakovdimitry,
Your app has a number of avenues to get valuable information to show to the user.
1. Your app knows if an option was constrained by another feature or a device setting. We expose an enum that indicates whether a constraint is a due to a hardware constraint or a conflicting feature.
2. Your app can see the state of installable options using the queue property bag.
3. Your app can also make any bidi queries necessary.
Between these three avenues, you should be able to build a user experience that is sufficiently informative. The data provided in the older COMPSTUI based dialog is not available, however.
Thanks!
Justin
- Marked as answer by kondakovdmitry Wednesday, April 25, 2012 3:37 AM
Tuesday, April 24, 2012 4:59 PM
All replies
-
I will look into this for you. Best Wishes - Eric
Thursday, April 19, 2012 5:03 PMModerator -
Kondakovdmitry,
In most cases, the constrained attribute is specified on all of the options that caused the invalid combination (a bad constraint JS file might mess this up). This is the best tactic I can recommend for printer extensions to determine how the current PrintTicket is constrained.
We do not support obtaining the GPD/PPD files directly from a printer extension. First, this breaks all the layering and makes you much more susceptible to regressions in the future, and second, enhanced Point and Print makes finding the GPD/PPD file rather tricky for non-Windows consumers.
Thanks!
Justin
- Proposed as answer by Justin Hutchings [MSFT] Monday, April 23, 2012 5:33 PM
- Marked as answer by kondakovdmitry Wednesday, April 25, 2012 3:36 AM
Monday, April 23, 2012 5:33 PM -
In most cases, the constrained attribute is specified on all of the options that caused the invalid combination (a bad constraint JS file might mess this up). This is the best tactic I can recommend for printer extensions to determine how the current PrintTicket is constrained.
Hello Justin,
Thank you for your answer.
This tactic might be quite acceptable in some cases but it still won't give enough information for device-constrained features. For example, the Booklet printing option might be constrained by some Device Option (e.g. the availability of Duplex Unit). In this case PrintCapabilities will have the "constrained" attribute for only one option of the invalid combination - for Booklet option, since PrintCapabilities does not include Installable Options.
What tactic would you recommend in this case to help user find the exact installable option that constrains the feature?
Note however, that the standard Printing preferences UI handles this case as well:
Tuesday, April 24, 2012 9:51 AM -
Hi Kondakovdimitry,
Your app has a number of avenues to get valuable information to show to the user.
1. Your app knows if an option was constrained by another feature or a device setting. We expose an enum that indicates whether a constraint is a due to a hardware constraint or a conflicting feature.
2. Your app can see the state of installable options using the queue property bag.
3. Your app can also make any bidi queries necessary.
Between these three avenues, you should be able to build a user experience that is sufficiently informative. The data provided in the older COMPSTUI based dialog is not available, however.
Thanks!
Justin
- Marked as answer by kondakovdmitry Wednesday, April 25, 2012 3:37 AM
Tuesday, April 24, 2012 4:59 PM -
Thank you for your answer!
However, it's a pity that the detailed data provided by old COMPSTUI is not available any more.
Will try to manage with what we have now.
Wednesday, April 25, 2012 3:51 AM