8.10 表单 XObjects¶
Form XObjects
8.10.1 概述¶
General
表单 XObject 是 PDF 内容流,它是对任意图形对象序列(包括路径对象、文本对象和采样图像)的自包含描述。一个表单 XObject 可以被多次绘制——无论是在多个页面上还是在同一页面的多个位置——每次都会产生相同的结果,只有在调用时的图形状态会有所不同。这种共享定义不仅在 PDF 文件中表示经济,而且在适当的情况下,合规的阅读器可以通过缓存表单 XObject 的渲染结果来优化执行,以便重复使用。
NOTE 1
表单 这个术语还指完全不同的对象,即 交互式表单(有时称为 AcroForm),在 12.7,"交互式表单" 中讨论。而这里描述的表单 XObject 对应于 PostScript 语言中的表单概念,交互式表单则是 PDF 版的常见纸质表单。任何未限定的 表单 一词应理解为指交互式表单;这里描述的表单类型总是明确称为表单 XObject。
表单 XObject 有多种用途:
- 正如其名称所示,表单 XObject 可以用作整个页面的模板。
EXAMPLE
一个打印填充税单的程序可以首先绘制固定模板作为表单 XObject,然后在其上绘制可变信息。
- 任何要重复使用的图形元素,如公司标志或计算机辅助设计系统输出中的标准组件,都可以定义为表单 XObject。
- 某些不属于页面内容的文档元素,如注释外观(见 12.5.5,"外观流"),应表示为表单 XObject。
- 一种专门类型的表单 XObject,称为组 XObject(PDF 1.4),可以用来将图形元素作为一个单元进行分组,以实现各种目的(见 8.10.3,"组 XObjects")。特别是,组 XObject 应用于透明成像模型中定义透明组和软掩膜(见 11.6.5.2,"软掩膜字典" 和 11.6.6,"透明组 XObjects")。
- 另一种专门类型的表单 XObject,称为引用 XObject(PDF 1.4),可以用来将一个 PDF 文档的内容导入另一个文档(见 8.10.4,"引用 XObjects")。
作者应执行以下两个具体操作来使用表单 XObject:
a) 定义表单 XObject 的外观。表单 XObject 是一个 PDF 内容流。流的字典部分(称为表单字典)应包含有关表单 XObject 的描述信息;流的主体应描述产生其外观的图形对象。表单字典的内容描述见 8.10.2,"表单字典"。
b) 绘制表单 XObject。Do 操作符(见 8.8,"外部对象")应绘制其名称作为操作数提供的表单 XObject。该名称应在当前资源字典的 XObject 子字典中定义。在调用此操作符之前,它出现的内容流应在图形状态中设置适当的参数。特别是,它应更改当前变换矩阵,以控制表单 XObject 在用户空间中的位置、大小和方向。
每个表单 XObject 都在自己的坐标系统中定义,称为 表单空间。表单字典中的 BBox 条目应在表单空间中表示,如表单 XObject 的内容流中使用的任何坐标,如路径坐标。表单字典中的 Matrix 条目应指定从表单空间到当前用户空间的映射。每次 Do 操作符绘制表单 XObject 时,此矩阵应与当前变换矩阵连接,以定义从表单空间到设备空间的映射。
NOTE 2
这与模式字典中的 Matrix 条目不同,模式字典将模式空间映射到使用该模式的内容流的初始用户空间。
当 Do 操作符应用于表单 XObject 时,合规阅读器应执行以下任务:
a) 保存当前图形状态,如同调用 q 操作符(见 8.4.4,"图形状态操作符")
b) 将表单字典的 Matrix 条目的矩阵与当前变换矩阵(CTM)连接
c) 根据表单字典的 BBox 条目剪切
d) 绘制表单内容流中指定的图形对象
e) 恢复保存的图形状态,如同调用 Q 操作符(见 8.4.4,"图形状态操作符")
除上述描述外,表单的初始图形状态应继承自调用 Do 时生效的图形状态。
A form XObject is a PDF content stream that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). A form XObject may be painted multiple times—either on several pages or at several locations on the same page—and produces the same results each time, subject only to the graphics state at the time it is invoked. Not only is this shared definition economical to represent in the PDF file, but under suitable circumstances the conforming reader can optimize execution by caching the results of rendering the form XObject for repeated reuse.
NOTE 1
The term form also refers to a completely different kind of object, an interactive form (sometimes called an AcroForm), discussed in 12.7, "Interactive Forms". Whereas the form XObjects described in this sub-clause correspond to the notion of forms in the PostScript language, interactive forms are the PDF equivalent of the familiar paper instrument. Any unqualified use of the word form is understood to refer to an interactive form; the type of form described here is always referred to explicitly as a form XObject.
Form XObjects have various uses:
- As its name suggests, a form XObject may serve as the template for an entire page.
EXAMPLE
A program that prints filled-in tax forms can first paint the fixed template as a form XObject and then paint the variable information on top of it.
- Any graphical element that is to be used repeatedly, such as a company logo or a standard component in the output from a computer-aided design system, may be defined as a form XObject.
- Certain document elements that are not part of a page’s contents, such as annotation appearances (see 12.5.5, "Appearance Streams"), shall be represented as form XObjects.
- A specialized type of form XObject, called a group XObject (PDF 1.4), can be used to group graphical elements together as a unit for various purposes (see 8.10.3, "Group XObjects"). In particular, group XObjects shall be used to define transparency groups and soft masks for use in the transparent imaging model (see 11.6.5.2, "Soft-Mask Dictionaries" and 11.6.6, "Transparency Group XObjects").
- Another specialized type of form XObject, a reference XObject (PDF 1.4), may be used to import content from one PDF document into another (see 8.10.4, "Reference XObjects").
A writer shall perform the following two specific operations in order to use a form XObject:
a) Define the appearance of the form XObject. A form XObject is a PDF content stream. The dictionary portion of the stream (called the form dictionary) shall contain descriptive information about the form XObject; the body of the stream shall describe the graphics objects that produce its appearance. The contents of the form dictionary are described in 8.10.2, "Form Dictionaries".
b) Paint the form XObject. The Do operator (see 8.8, "External Objects") shall paint a form XObject whose name is supplied as an operand. The name shall be defined in the XObject subdictionary of the current resource dictionary. Before invoking this operator, the content stream in which it appears should set appropriate parameters in the graphics state. In particular, it should alter the current transformation matrix to control the position, size, and orientation of the form XObject in user space.
Each form XObject is defined in its own coordinate system, called form space. The BBox entry in the form dictionary shall be expressed in form space, as shall be any coordinates used in the form XObject’s content stream, such as path coordinates. The Matrix entry in the form dictionary shall specify the mapping from form space to the current user space. Each time the form XObject is painted by the Do operator, this matrix shall be concatenated with the current transformation matrix to define the mapping from form space to device space.
NOTE 2
This differs from the Matrix entry in a pattern dictionary, which maps pattern space to the initial user space of the content stream in which the pattern is used.
When the Do operator is applied to a form XObject, a conforming reader shall perform the following tasks:
a) Saves the current graphics state, as if by invoking the q operator (see 8.4.4, "Graphics State Operators")
b) Concatenates the matrix from the form dictionary’s Matrix entry with the current transformation matrix (CTM)
c) Clips according to the form dictionary’s BBox entry
d) Paints the graphics objects specified in the form’s content stream
e) Restores the saved graphics state, as if by invoking the Q operator (see 8.4.4, "Graphics State Operators")
Except as described above, the initial graphics state for the form shall be inherited from the graphics state that is in effect at the time Do is invoked.
8.10.2 表单字典¶
Form Dictionaries
每个表单 XObject 都应具有一个 表单类型,它决定了其表单字典中条目的格式和含义。此规范仅定义了一种表单类型,即类型 1。表单 XObject 字典除了所有流共有的常规条目(见 表 5)之外,还可能包含 表 95 中显示的条目。
Key | Type | Value |
---|---|---|
Type | name | (可选) 此字典描述的 PDF 对象的类型;如果存在,对于表单 XObject 应为 XObject。 |
Subtype | name | (必需) 此字典描述的 XObject 类型;对于表单 XObject 应为 Form 。 |
FormType | integer | (可选) 标识此字典描述的表单 XObject 类型的代码。唯一有效的值为 1。默认值:1。 |
BBox | rectangle | (必需) 以表单坐标系统(见上文)表示的四个数值数组,分别给出表单 XObject 的边界框的左、下、右和上边界。 |
Matrix | array | (可选) 一个包含六个数值的数组,指定将表单空间映射到用户空间的矩阵(见 8.3.4,"变换矩阵")。默认值:单位矩阵 [1 0 0 1 0 0]。 |
Resources | dictionary | (可选但强烈推荐;PDF 1.2) 一个字典,指定表单 XObject 所需的任何资源(如字体和图像)(见 7.8,"内容流和资源")。 在PDF版本为1.1及更早版本中,表单XObject中使用的所有命名资源都应包含在每个页面对象的资源字典中,无论它们是否也出现在表单XObject的资源字典中。这些资源也应该在表单XObject的资源字典中指定,以确定表单XObject内部使用哪些资源。如果资源同时包含在两个字典中,它在两个位置的名称必须相同。 在PDF 1.2及更高版本中,表单XObject可以独立于它们出现的Content Streams,虽然不是必需的,但强烈推荐这样做。在独立表单XObject中,表单XObject的资源字典是必需的,并且应包含表单XObject使用的所有命名资源。这些资源不应提升到外部内容流的资源字典中,尽管该流的资源字典引用了表单XObject。 |
Group | dictionary | (可选;PDF 1.4) 一个组属性字典,指示表单 XObject 的内容应作为一个组进行处理,并指定该组的属性(见 8.10.3,"组 XObjects")。 如果存在 Ref 条目(见下文),组属性也应适用于通过该条目导入的外部页面,使得此类导入页面可以作为一个组处理,而无需进一步修改。 |
Ref | dictionary | (可选;PDF 1.4) 一个引用字典,标识要从另一个 PDF 文件导入的页面,表单 XObject 作为该页面的代理(见 8.10.4,"引用 XObjects")。 |
Metadata | stream | (可选;PDF 1.4) 包含表单 XObject 元数据的元数据流(见 14.3.2,"元数据流")。 |
PieceInfo | dictionary | (可选;PDF 1.3) 一个与表单 XObject 关联的页面片段字典(见 14.5,"页面片段字典")。 |
LastModified | date | (如果存在 PieceInfo 则为必需;否则为可选;PDF 1.3) 表单 XObject 内容最近修改的日期和时间(见 7.9.4,"日期")。如果存在页面片段字典 (PieceInfo),修改日期应用于确定其包含的应用程序数据字典对应于表单的当前内容(见 14.5,"页面片段字典")。 |
StructParent | integer | (如果表单 XObject 是结构内容项则必需;PDF 1.3) 表单 XObject 在结构父树中的条目的整数键(见 14.7.4.4,"从内容项查找结构元素")。 |
StructParents | integer | (如果表单 XObject 包含作为结构内容项的标记内容序列则必需;PDF 1.3) 表单 XObject 在结构父树中的条目的整数键(见 14.7.4.4,"从内容项查找结构元素")。StructParent 或 StructParents 中最多只能有一个条目。一个表单 XObject 应该作为一个整体内容项,或作为包含标记内容序列的容器,但不能两者兼具。 |
OPI | dictionary | (可选;PDF 1.2) 表单 XObject 的 OPI 版本字典(见 14.11.7,"开放印前接口 (OPI)")。 |
OC | dictionary | (可选;PDF 1.5) 可选内容组或可选内容成员字典(见 8.11,"可选内容"),指定表单 XObject 的可选内容属性。在处理表单之前,应根据此条目确定其可见性。如果确定为不可见,应跳过整个表单,就像没有调用 Do 操作符一样。 |
Name | name | (PDF 1.0 中必需;否则为可选) 在当前资源字典的 XObject 子字典中引用此表单 XObject 的名称(见 7.8.3,"资源字典")。
NOTE 此条目已过时,不再推荐使用。 |
EXAMPLE
以下是一个简单的表单XObject示例,绘制一个边长为1000单位的实心正方形.
6 0 obj % Form XObject
<< /Type /XObject
/Subtype /Form
/FormType 1
/BBox [ 0 0 1000 1000 ]
/Matrix [ 1 0 0 1 0 0 ]
/Resources << /ProcSet [ /PDF ] >>
Length 58
>>
stream
0 0 m
0 1000 l
1000 1000 l
1000 0 l
f
endstream
endobj
Every form XObject shall have a form type, which determines the format and meaning of the entries in its form dictionary. This specification only defines one form type, Type 1. Form XObject dictionaries may contain the entries shown in Table 95, in addition to the usual entries common to all streams (see Table 5).
Key | Type | Value |
---|---|---|
Type | name | (Optional) The type of PDF object that this dictionary describes; if present, shall be XObject for a form XObject. |
Subtype | name | (Required) The type of XObject that this dictionary describes; shall be Form for a form XObject. |
FormType | integer | (Optional) A code identifying the type of form XObject that this dictionary describes. The only valid value is 1. Default value: 1. |
BBox | rectangle | (Required) An array of four numbers in the form coordinate system (see above), giving the coordinates of the left, bottom, right, and top edges, respectively, of the form XObject’s bounding box. These boundaries shall be used to clip the form XObject and to determine its size for caching. |
Matrix | array | (Optional) An array of six numbers specifying the form matrix, which maps form space into user space (see 8.3.4, "Transformation Matrices"). Default value: the identity matrix [1 0 0 1 0 0]. |
Resources | dictionary | (Optional but strongly recommended; PDF 1.2) A dictionary specifying any resources (such as fonts and images) required by the form XObject (see 7.8, "Content Streams and Resources"). In a PDF whose version is 1.1 and earlier, all named resources used in the form XObject shall be included in the resource dictionary of each page object on which the form XObject appears, regardless of whether they also appear in the resource dictionary of the form XObject. These resources should also be specified in the form XObject’s resource dictionary as well, to determine which resources are used inside the form XObject. If a resource is included in both dictionaries, it shall have the same name in both locations. In PDF 1.2 and later versions, form XObjects may be independent of the content streams in which they appear, and this is strongly recommended although not required. In an independent form XObject, the resource dictionary of the form XObject is required and shall contain all named resources used by the form XObject. These resources shall not be promoted to the outer content stream’s resource dictionary, although that stream’s resource dictionary refers to the form XObject. |
Group | dictionary | (Optional; PDF 1.4) A group attributes dictionary indicating that th contents of the form XObject shall be treated as a group an specifying the attributes of that group (see 8.10.3, "Group XObjects"). If a Ref entry (see below) is present, the group attributes shall also apply to the external page imported by that entry, which allows such an imported page to be treated as a group without further modification. |
Ref | dictionary | (Optional; PDF 1.4) A reference dictionary identifying a page to be imported from another PDF file, and for which the form XObject serves as a proxy (see 8.10.4, "Reference XObjects"). |
Metadata | stream | (Optional; PDF 1.4) A metadata stream containing metadata for the form XObject (see 14.3.2, "Metadata Streams"). |
PieceInfo | dictionary | (Optional; PDF 1.3) A page-piece dictionary associated with the form XObject (see 14.5, "Page-Piece Dictionaries"). |
LastModified | date | (Required if PieceInfo is present; optional otherwise; PDF 1.3) The date and time (see 7.9.4, "Dates") when the form XObject’s contents were most recently modified. If a page-piece dictionary (PieceInfo) is present, the modification date shall be used to ascertain which of the application data dictionaries it contains correspond to the current content of the form (see 14.5, "Page-Piece Dictionaries"). |
StructParent | integer | (Required if the form XObject is a structural content item; PDF 1.3) The integer key of the form XObject’s entry in the structural parent tree (see 14.7.4.4, "Finding Structure Elements from Content Items"). |
StructParents | integer | (Required if the form XObject contains marked-content sequences that are structural content items; PDF 1.3) The integer key of the form XObject’s entry in the structural parent tree (see 14.7.4.4, "Finding Structure Elements from Content Items"). At most one of the entries StructParent or StructParents shall be present. A form XObject shall be either a content item in its entirety or a container for marked-content sequences that are content items, but not both. |
OPI | dictionary | (Optional; PDF 1.2) An OPI version dictionary for the form XObject (see 14.11.7, "Open Prepress Interface (OPI)"). |
OC | dictionary | (Optional; PDF 1.5) An optional content group or optional content membership dictionary (see 8.11, "Optional Content") specifying the optional content properties for the form XObject. Before the form is processed, its visibility shall be determined based on this entry. If it is determined to be invisible, the entire form shall be skipped, as if there were no Do operator to invoke it. |
Name | name | (Required in PDF 1.0; optional otherwise) The name by which this form XObject is referenced in the XObject subdictionary of the current resource dictionary (see 7.8.3, "Resource Dictionaries").
NOTE This entry is obsolescent and its use is no longer recommended.
|
EXAMPLE
The following shows a simple form XObject that paints a filled square 1000 units on each side.
6 0 obj % Form XObject
<< /Type /XObject
/Subtype /Form
/FormType 1
/BBox [ 0 0 1000 1000 ]
/Matrix [ 1 0 0 1 0 0 ]
/Resources << /ProcSet [ /PDF ] >>
Length 58
>>
stream
0 0 m
0 1000 l
1000 1000 l
1000 0 l
f
endstream
endobj
8.10.3 XObject 组合¶
Group XObjects
组 XObject(PDF 1.4)是一种特殊类型的表单 XObject,用于将图形元素作为一个单元进行组合,以实现各种目的。它应通过表单字典中的可选 Group 条目加以区分(见 8.10.2,"表单字典")。该条目的值应为描述组属性的子组 属性字典。
如 表 96 所示,每个组 XObject 应具有一个组子类型(由组属性字典中的 S 条目指定),该子类型决定字典剩余条目的格式和含义。本规范仅定义一种子类型,即用于透明成像模型的 透明组 XObject(子类型 Transparency)(见 11.4,"透明组")。此类字典的剩余内容详见 11.6.6,"透明组 XObjects"。
Key | Type | Value |
---|---|---|
Type | name | (可选) 此字典描述的 PDF 对象的类型;如果存在,对于组属性字典应为 Group 。 |
S | name | (必需) 组子类型,标识此字典描述的组类型,并决定字典剩余条目的格式和含义。唯一定义的组子类型是 Transparency ;此类型字典的剩余内容详见 11.6.6,"透明度组 XObjects"。 |
A group XObject (PDF 1.4) is a special type of form XObject that can be used to group graphical elements together as a unit for various purposes. It shall be distinguished by the presence of the optional Group entry in the form dictionary (see 8.10.2, "Form Dictionaries"). The value of this entry shall be a subsidiary group attributes dictionary describing the properties of the group.
As shown in Table 96, every group XObject shall have a group subtype (specified by the S entry in the group attributes dictionary) that determines the format and meaning of the dictionary’s remaining entries. This specification only defines one subtype, a transparency group XObject (subtype Transparency) representing a transparency group for use in the transparent imaging model (see 11.4, "Transparency Groups"). The remaining contents of this type of dictionary are described in 11.6.6, "Transparency Group XObjects".
Key | Type | Value |
---|---|---|
Type | name | (Optional) The type of PDF object that this dictionary describes; if present, shall be Group for a group attributes dictionary. |
S | name | (Required) The group subtype, which identifies the type of group whose attributes this dictionary describes and determines the format and meaning of the dictionary’s remaining entries. The only group subtype defined is Transparency; see 11.6.6, "Transparency Group XObjects", for the remaining contents of this type of dictionary. |
8.10.4 XObjects 引用¶
Reference XObjects
8.10.4.1 概述¶
General
引用 XObjects(PDF 1.4)允许一个PDF文档从另一个文档导入内容。引用发生的文档称为 包含文档;被导入内容的文档称为 目标文档。目标文档可能位于包含文档之外的文件中,或者作为嵌入文件流包含在其中(见 7.11.4,"嵌入文件流")。
包含文档中的引用XObject应该是一个表单XObject,在其表单字典中包含 Ref 条目,如下所述。这个表单XObject应作为一个 代理,由符合规范的阅读器在导入内容的位置显示或打印。
NOTE 3
代理可能包括导入内容的低分辨率图像、引用它的描述性文本、在其位置显示的灰色盒子,或任何其他类似的占位符。
不认识 Ref 条目的符合规范的阅读器将简单地将代理显示或打印为一个普通的表单XObject。那些实现了引用XObject的阅读器将在导入内容不可用时使用代理代替它。符合规范的阅读器还可能提供用户界面,允许编辑和更新导入内容的链接。
导入的内容应由目标文档中的一个单一、完整的PDF页面组成。它应由一个 引用字典 指定,该字典又是引用 XObject 表单字典中 Ref 条目的值(见 8.10.2,"表单字典")。 Ref 条目的存在将区分引用 XObjects 和其他类型的表单 XObjects。表 97 显示了引用字典的内容。
Key | Type | Value |
---|---|---|
F | file specification | (必需) 包含目标文档的文件。 |
Page | integer or text string | (必需) 页面索引或页面标签(见 12.4.2,"页面标签")用于标识包含要导入内容的目标文档的页面。此引用是一个弱引用,如果在创建引用后,目标文档中的引用页面被更改或替换,则可能会无意中使其失效。 |
ID | array | (可选) 一个包含两个字节字符串的数组,构成包含目标文档的文件的文件标识符(见 14.4,"文件标识符")。使用此条目可以提高阅读器找到目标文件的可能性,并在文件自创建引用以来发生变化时提醒用户。 |
当导入的内容替换代理时,应根据代理对象的变换矩阵进行变换,并根据代理的表单字典中的 Matrix 和 BBox 条目(见 8.10.2,"表单字典")将其裁剪到边界框的边界内。代理对象的矩阵和边界框的组合隐式定义了导入页面的边界框。该边界框通常与导入页面的裁剪框或艺术框(见 14.11.2,"页面边界")一致,但可能不对应于任何已定义的页面边界。如果代理对象的表单字典包含 Group 条目,则指定的组属性也应适用于导入的页面,从而允许导入的页面无需进一步修改即可作为一个组进行处理。
Reference XObjects (PDF 1.4) enable one PDF document to import content from another. The document in which the reference occurs is called the containing document; the one whose content is being imported is the target document. The target document may reside in a file external to the containing document or may be included within it as an embedded file stream (see 7.11.4, "Embedded File Streams").
The reference XObject in the containing document shall be a form XObject containing the Ref entry in its form dictionary, as described below. This form XObject shall serve as a proxy that shall be displayed or printed by a conforming reader in place of the imported content.
NOTE 3
The proxy might consist of a low-resolution image of the imported content, a piece of descriptive text referring to it, a gray box to be displayed in its place, or any other similar placeholder.
Conforming readers that do not recognize the Ref entry shall simply display or print the proxy as an ordinary form XObject. Those readers that do implement reference XObjects shall use the proxy in place of the imported content if the latter is unavailable. A conforming reader may also provide a user interface to allow editing and updating of imported content links.
The imported content shall consist of a single, complete PDF page in the target document. It shall be designated by a reference dictionary, which in turn shall be the value of the Ref entry in the reference XObject’s form dictionary (see 8.10.2, "Form Dictionaries"). The presence of the Ref entry shall distinguish reference XObjects from other types of form XObjects. Table 97 shows the contents of the reference dictionary.
Key | Type | Value |
---|---|---|
F | file specification | (Required) The file containing the target document. |
Page | integer or text string | (Required) A page index or page label (see 12.4.2, "Page Labels") identifying the page of the target document containing the content to be imported. This reference is a weak one and may be inadvertently invalidated if the referenced page is changed or replaced in the target document after the reference is created. |
ID | array | (Optional) An array of two byte strings constituting a file identifier (see 14.4, "File Identifiers") for the file containing the target document. The use of this entry improves an reader’s chances of finding the intended file and allows it to warn the user if the file has changed since the reference was created. |
When the imported content replaces the proxy, it shall be transformed according to the proxy object’s transformation matrix and clipped to the boundaries of its bounding box, as specified by the Matrix and BBox entries in the proxy’s form dictionary (see 8.10.2, "Form Dictionaries"). The combination of the proxy object’s matrix and bounding box thus implicitly defines the bounding box of the imported page. This bounding box typically coincides with the imported page’s crop box or art box (see 14.11.2, "Page Boundaries"), but may not correspond to any of the defined page boundaries. If the proxy object’s form dictionary contains a Group entry, the specified group attributes shall apply to the imported page as well, which allows the imported page to be treated as a group without further modification.
8.10.4.2 打印引用 XObjects¶
Printing Reference XObjects
当打印包含引用 XObjects 的页面时,应用程序可能会根据符合规范的阅读器的功能、用户的偏好以及打印作业的性质,发出以下任何一项:
- 由引用 XObject 指定的导入内容
- 作为导入内容代理的引用 XObject
- 如果有的话,从引用 XObject 的 OPI 字典中取出的 OPI 代理或替代图像(见 14.11.7,"开放预印刷接口 (OPI)")
符合规范的阅读器在生成 PostScript 输出流中的 OPI 注释时,也可能发出导入内容或引用 XObject 来代替 OPI 代理。
When printing a page containing reference XObjects, an application may emit any of the following items, depending on the capabilities of the conforming reader, the user’s preferences, and the nature of the print job:
- The imported content designated by the reference XObject
- The reference XObject as a proxy for the imported content
- An OPI proxy or substitute image taken from the reference XObject’s OPI dictionary, if any (see 14.11.7, "Open Prepress Interface (OPI)")
The imported content or the reference XObject may also be emitted, by a conforming reader, in place of an OPI proxy when generating OPI comments in a PostScript output stream.
8.10.4.3 特别注意事项¶
Special Considerations
当引用 XObjects 与其他 PDF 功能交互时,会出现一些特别的考虑:
- 当被引用 XObject 导入的页面包含注释(见 12.5,"注释")时,所有包含可打印、未隐藏、可见的外观流的注释(12.5.5,"外观流")应包含在导入页面的渲染中。如果代理是导入页面的快照图像,它也应包括注释的外观。因此,这些外观应转换为代理内容流的一部分,无论是作为附属的表单 XObjects 还是直接平铺进内容流中。
- 与页面相关联的逻辑结构信息(见 14.7,"逻辑结构")在将页面导入另一个文档时可能会被忽略。在具有多个页面的目标文档中,出现在导入页面上的结构元素通常是整个文档较大结构的一部分;这样的元素无法有意义地并入包含文档的结构中。在一个单页目标文档或由独立、结构无关的页面组成的文档中,导入页面的逻辑结构可能是完全自包含的;在这种情况下,可能可以将此结构信息并入包含文档的结构中。然而,PDF 没有提供一种机制,使得一个文档的逻辑结构层次能够间接引用另一个文档的逻辑结构层次。
Certain special considerations arise when reference XObjects interact with other PDF features:
- When the page imported by a reference XObject contains annotations (see 12.5, "Annotations"), all annotations that contain a printable, unhidden, visible appearance stream (12.5.5, "Appearance Streams") shall be included in the rendering of the imported page. If the proxy is a snapshot image of the imported page, it shall also include the annotation appearances. These appearances shall therefore be converted into part of the proxy’s content stream, either as subsidiary form XObjects or by flattening them directly into the content stream.
- Logical structure information associated with a page (see 14.7, "Logical Structure") may be ignored when importing the page into another document with a reference XObject. In a target document with multiple pages, structure elements occurring on the imported page are typically part of a larger structure pertaining to the document as a whole; such elements cannot meaningfully be incorporated into the structure of the containing document. In a one-page target document or one made up of independent, structurally unrelated pages, the logical structure for the imported page may be wholly self-contained; in this case, it may be possible to incorporate this structure information into that of the containing document. However, PDF provides no mechanism for the logical structure hierarchy of one document to refer indirectly to that of another.