注释和已忽略的块
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"
}
}
}
}