大网数据广告活动
打印与设备

Using Parameters

· 52CE 我爱测

Learn to use parameters in a PrintCapabilities document. This topic is not current. For the most current information, see the Print Schema Specification.

This topic is not current. For the most current information, see the Print Schema Specification.

In addition to properly scoring an Option that contains ParameterRef instances (see Referencing Parameters), PrintCapabilities or PrintTicket providers and clients must be prepared to handle the following situations involving parameters.

User interface (UI) clients must prompt the user to provide parameter initializers (values for ParameterInit elements) for designated parameters at the appropriate time so that the appropriate ParameterInit elements are inserted into the PrintTicket. UI clients must be able to distinguish the two types of parameters, unconditionally mandatory, and conditionally mandatory, and must be able to handle each type appropriately. For an unconditionally mandatory parameter, the UI must ensure that a ParameterInit element is provided for this type of parameter. For a conditionally mandatory parameter, the UI must provide a ParameterInit value if the parameter is referenced by an Option that is selected in the PrintTicket. The Mandatory status of a parameter is specified in a ParameterDef instance. For more information, see ParameterDef and ParameterInit Elements. UI clients should validate user-supplied ParameterInit values to verify that they satisfy the requirements specified in the ParameterDef instance.

PrintTicket providers should also check the ParameterInit instances supplied by the PrintTicket to verify that all needed parameters are present, and that they satisfy the requirements specified in the ParameterDef instance. The validation code should supply reasonable defaults in the event that ParameterInit values are invalid or missing. Notice that a ParameterDef permits a default value to be supplied for this purpose. Also, if there are constraints involving the parameters, for example, "if CopyCount is larger than N, then do not use a small capacity input bin," the PrintTicket validation code should detect this constraint and modify the PrintTicket to avoid activating the constraint.

If there is any dependency of the PrintCapabilities on the parameters specified in the PrintTicket, PrintCapabilities providers must monitor the ParameterInit values and produce an appropriate PrintCapabilities document.

Related topics

Print Schema Specification

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。