14.5 页面-片段字典¶
14.5 Page-Piece Dictionaries
一个 页面片段字典(page-piece dictionary,PDF 1.3)可以用于存储专有的符合规范的产品数据。通过页面对象中的可选 PieceInfo 项(参见表 30)或表单字典(参见 表 95),可以将这些数据与页面或表单 XObject 相关联。从 PDF 1.4 开始,还可以通过文档目录中的 PieceInfo 项(参见表 28)将专有数据与 PDF 文档相关联。
注意 1
符合规范的产品可以使用此字典来存储与该文档、页面或表单相关的专有数据。这些专有数据可以传递对生成它的符合规范的产品有意义的信息(例如图形编辑器的对象分组信息或 Adobe Photoshop® 使用的图层信息),但通用的符合规范的阅读器可能会忽略这些数据。
如表 318 所示,页面片段字典可以包含任意数量的条目,每个条目以一个特定符合规范的产品名称或一组符合规范产品认可的知名数据类型的名称为键。与每个键关联的值应为一个数据字典,其中包含供符合规范的产品使用的专有数据。Private 项的值可以是任何数据类型,但通常是一个字典,包含除了文档、页面或表单的实际内容之外所需的所有专有数据。
键 | 类型 | 值 |
---|---|---|
任意符合规范的产品名称或知名数据类型 | 字典 | 一个数据字典(参见 表 319)。 |
键 | 类型 | 值 |
---|---|---|
LastModified | 日期 | (必需)此符合规范的产品最近修改文档、页面或表单内容的日期和时间。 |
Private | (任意) | (可选)符合规范的产品适用的任何专有数据,通常是一个字典。 |
LastModified 项表示此符合规范的产品最后一次修改页面或表单内容的时间。如果页面片段字典包含多个数据字典,可以将它们的修改日期与页面对象或表单字典中的相应条目(参见 表 30 和 表 95),或文档信息字典的 ModDate 项(参见 表 317)进行比较,以确定哪个数据字典对应于页面或表单的当前内容。由于某些平台可能只使用近似的日期和时间值,或者无法正确处理不同的时区,修改日期只能进行相等性比较,而不能用于顺序排序。
注意 2
两个或多个数据字典可能具有相同的修改日期。符合规范的产品可以利用此功能定义同一数据格式的多个版本或扩展版本。例如,假设某符合规范的产品的早期版本使用名为 PictureEdit 的数据字典,而该产品的后续版本扩展了数据以包括以前未使用的附加项。原始数据可以继续保存在 PictureEdit 字典中,而附加项则放置在名为 PictureEditExtended 的新字典中。这使得早期版本的符合规范的产品能够像以前一样继续工作,而后续版本能够定位并使用扩展的数据项。
A page-piece dictionary (PDF 1.3) may be used to hold private conforming product data. The data may be associated with a page or form XObject by means of the optional PieceInfo entry in the page object (see Table 30) or form dictionary (see Table 95). Beginning with PDF 1.4, private data may also be associated with the PDF document by means of the PieceInfo entry in the document catalogue (see Table 28).
NOTE 1
Conforming products may use this dictionary as a place to store private data in connection with that document, page, or form. Such private data can convey information meaningful to the conforming product that produces it (such as information on object grouping for a graphics editor or the layer information used by Adobe Photoshop®) but may be ignored by general-purpose conforming readers.
As Table 318 shows, a page-piece dictionary may contain any number of entries, each keyed by the name of a distinct conforming product or of a well-known data type recognized by a family of conforming products. The value associated with each key shall be a data dictionary containing the private data that shall be used by the conforming product. The Private entry may have a value of any data type, but typically it is a dictionary containing all of the private data needed by the conforming product other than the actual content of the document, page, or form.
Key | Type | Value |
---|---|---|
any conforming product name or well-known data type | dictionary | A data dictionary (see Table 319). |
Key | Type | Value |
---|---|---|
LastModified | date | (Required) The date and time when the contents of the document, page, or form were most recently modified by this conforming product. |
Private | (any) | (Optional) Any private data appropriate to the conforming product, typically in the form of a dictionary. |
The LastModified entry indicates when this conforming product last altered the content of the page or form. If the page-piece dictionary contains several data dictionaries, their modification dates can be compared with those in the corresponding entry of the page object or form dictionary (see Table 30 and Table 95), or the ModDate entry of the document information dictionary (see Table 317), to ascertain which data dictionary corresponds to the current content of the page or form. Because some platforms may use only an approximate value for the date and time or may not deal correctly with differing time zones, modification dates shall be compared only for equality and not for sequential ordering.
NOTE 2
It is possible for two or more data dictionaries to have the same modification date. Conforming products can use this capability to define multiple or extended versions of the same data format. For example, suppose that earlier versions of a conforming product use an data dictionary named PictureEdit, and later versions of the same conforming product extend the data to include additional items not previously used. The original data could continue to be kept in the PictureEdit dictionary and the additional items placed in a new dictionary named PictureEditExtended. This allows the earlier versions of the conforming product to continue to work as before, and later versions are able to locate and use the extended data items.