跳转至

附录 J(资料性)FDF 重命名标志实现示例

Annex J (informative) FDF Rename Flag Implementation Example

J.1 概述

J.1 General

Rename 标志用于指定从模板导入的字段在名称与现有字段冲突时是否应重命名;

The Rename flag is used to specify whether fields imported from the template shall be renamed in the event of name conflicts with existing fields;

J.2 实现示例

J.2 Implementation Example

如果 FDF 模板字典中的 Rename 标志为 true,则应重命名具有此类冲突名称的字段以保证其唯一性。如果 Renamefalse,则不应重命名这些字段;这会导致目标文档中出现多个同名字段。每次 FDF 文件为给定字段名称提供属性时,应更新所有具有该名称的字段。

这可以通过符合要求的产品通过在字段名称前添加页码、模板名称和序数来重命名字段来实现。序数对应于模板应用于页面的顺序,其中 0 表示为该页面指定的第一个模板。

EXAMPLE

如果第五页上使用的第一个模板的名称为 Template,并且 Rename 标志设置为 true,则通过在字段名称前添加字符串 P5 . Template_0 . 来重命名该模板中定义的字段。

If the Rename flag in the FDF template dictionary is true, fields with such conflicting names shall be renamed to guarantee their uniqueness. If Rename is false, the fields shall not be renamed; this results in multiple fields with the same name in the target document. Each time the FDF file provides attributes for a given field name, all fields with that name shall be updated.

This can be implemented by a conforming product renaming fields by prepending a page number, a template name, and an ordinal number to the field name. The ordinal number corresponds to the order in which the template is applied to a page, with 0 being the first template specified for the page.

EXAMPLE

If the first template used on the fifth page has the name Template and has the Rename flag set to true, fields defined in that template are renamed by prepending the character string P5 . Template_0 . to their field names.