注释和忽略的块

重要

建议使用 Microsoft 的 IPP 收件箱类驱动程序,以及 Print Support Apps (PSA) ,在 Windows 10 和 11 中自定义打印体验,以便进行打印机设备开发。

有关详细信息,请参阅 打印支持应用设计指南

GPD 文件可以包含注释。 注释的格式如下所示:

*%CommentString

其中 CommentString 是以行终止符结尾的任何字符串。 多行注释的每一行都必须以 *% 字符序列开头。 序列 *% 前面必须有空格或换行符。

下面是有效注释的示例:

*% This section of the GPD file
*% contains macro definitions.
*Macros: HP4L
{
    *% These macros define command prefixes for the paper size feature.
    LetterCmdPrefix: "<1B>&l2a8c1E<1B>*p0x0Y"  *% Prefix for letter option.
    A4CmdPrefix: "<1B>&l26a8c1E<1B>*p0x0Y"     *% Prefix for A4 option.
    Env10CmdPrefix: "<1B>&l81a8c1E<1B>*p0x0Y"  *% Prefix for Env10 option.
}

若要请求 GPD 分析程序忽略一组 GPD 条目,可以创建包含要忽略的条目的忽略块。 忽略块的格式如下所示:

*IgnoreBlock { IgnoredEntries }

其中 ,IgnoredEntries 是一组 GPD 文件条目,包含相等数量的左大括号和右大括号。

在以下示例中,GPD 分析程序忽略描述 LANDSCAPE_CC90 选项的 GPD 条目。

*Feature: Orientation
{
    *Name: "Orientation"
    *DefaultOption: Portrait
    *Option: Portrait
    {
        *Name: "Portrait"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.7
            *Cmd: "<1B>&l0O"
        }
    }
*IgnoreBlock
{
    *Option: LANDSCAPE_CC90
    {
        *Name: "Landscape"
        *Command: CmdSelect
        {
            *Order: DOC_SETUP.7
            *Cmd: "<1B>&l1O"
        }
    }
}
}