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

Constraints and PrintTicket Validation

· 52CE 我爱测

In order to prevent constraint conflicts, PrintTicket providers must support validation that clients use to perform validation on their PrintTicket.

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

As discussed in the PrintCapabilities Schema section, some of the possible configuration outcomes expressed in a PrintCapabilities document are invalid for the device. Configurations that are invalid are said to contain constraint conflicts (a term used in the world of PPD/GPD files). In order to prevent constraint conflicts, PrintTicket providers must support a PrintTicket validation operation that clients use to perform validation on their PrintTicket. This operation should detect whether the specified configuration can occur on the device. If the configuration cannot occur (because the Feature and Option elements specified do not exist in the current device, or because the configuration is constrained), the operation should modify the input PrintTicket so that it contains valid, unconstrained settings. The operation might remove or validate other information in the PrintTicket as well. Note that when a constraint conflict is encountered, the validation code must change the setting of one of the device attributes in order to avoid the constraint conflict. Option Definitions suggests that a device driver defined scoring process should be used to determine which device attribute should be changed in order to best preserve the user's original intent. The validation code might hardcode the scoring process to favor one device attribute over another, or it might use information supplied by a particular Property instance in the PrintTicket to guide resolution. Because there is no Property defined in the Print Schema Keywords that allows clients to specify the relative priority of each device attribute, any private PrintTicket Property elements used for this purpose are likely to be ignored by other PrintTicket providers.

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)

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

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