使用设计脚本,您可以创建包含书签、内部文档链接、Web URL 链接、附件、数字签名字段和多媒体的激活呈现副本(内容丰富的 PDF 文档)。这是使用操作关键字完成的。操作关键字在设计脚本中的出现顺序极其重要。
操作关键字 | 顺序 |
---|---|
action_item | 第一 |
action_name | 第二 |
action_instance | 第三(指定时) |
您还可以使用属性发布关键字将对象元数据发布到 PDF 文档,这称为属性发布。属性发布是发布与 PDF 文档中的图元相关联的对象元数据的过程。使用 Acrobat 7.0 或更高版本,您可以使用 Acrobat 的对象数据工具查看与图元关联的元数据信息。
以下操作关键字包括关键字函数的介绍、受关键字影响的元素类型(如果适用)、有效数据类型(如果适用)以及如何使用关键字的示例。
指定要创建的操作项目的类型(书签、链接、附件、数字签名字段或多媒体),这是定义激活呈现副本时的必填字段。此关键字必须在所有其他操作关键字之前出现。
以下常量适用于 action_item 关键字:
语法:
ACTION_ITEM = <LINK | BOOKMARK | MARKER | MEDIA | FIELD | ATTACHMENT>
指定要与 action_item 赋值关联的操作类型,这是定义激活呈现副本时的必填字段。
以下常量适用于 action_type 关键字:
If((level_name eq "one") and (type eq shape)) then
action_item = marker
action_name = "Air Handler"
action_type = destination
endif
语法
ACTION_TYPE = <WEB_URL | DESTINATION | DOCUMENT | PLAY_SOUND | PLAY_MEDIA | DIGSIG_FIELD | AREA_OF_INTEREST | FILE_ATTACHMENT |SOUND_ATTACHMENT | MOVIE_ATTACHMENT | TEXT_DESCRIPTION>
Action_name 和 action_spec 值不是预置常量,而是与所定义的 action_item 和 action_type 对应的唯一值。
Action_name 通常是用于标识由 action_item 所定义对象的内部唯一名称。标识 Web 链接书签或声音剪辑书签时例外。对于 Web 链接书签,action_name 关键字标识 URL。对于声音剪辑书签,action_name 标识声音文件的文件规范。定义 action_item 时,Action_name 是必填字段。
Action_spec 指定书签在书签层次中的位置、媒体或附件项目的文件规范、当用户将鼠标悬停在 Adobe Acrobat 中的数字签名字段时显示的字符串,以及链接标记的显式名称(例如 sheet_name.marker_name)。这是定义 action_item 时的必填字段,标记项目除外。
语法:
action_name = string
action_spec = string
下表提供了每个相应 action_type 的可接受值的列表。
ACTION_TYPE | ACTION_NAME | ACTION_SPEC |
---|---|---|
AREA_OF_INTEREST | 用于标识书签项的唯一字符串。 | 指定书签在书签层次结构中的位置。 |
DESTINATION | 标记的唯一名称。 | 不适用 |
DIGSIG_FIELD | 用于标识数字签名的唯一字符串。 | 当用户将鼠标悬停在 Acrobat 中的数字签名字段时显示的字符串。 |
DOCUMENT | 用于在文档书签中标识图纸名称的唯一字符串。 | 指定书签在书签层次结构中的位置。对于链接,它指定标记的显式名称(例如 sheet_name.marker_name)。 |
FILE_ATTACHMENT | 文件附件的唯一名称。 | 文件规范。 |
MOVIE_ATTACHMENT | 影片附件的唯一名称。 | 影片文件规范。 |
PLAY_MEDIA | 电影或声音剪辑的唯一名称。 | 电影或声音文件说明。 |
PLAY_SOUND | 声音文件的文件规范。 | 指定书签在书签层次结构中的位置。 |
SOUND_ATTACHMENT | 声音附件的唯一名称。 | 声音文件规范。 |
TEXT_DESCRIPTION | 用于标识书签项的唯一字符串。 | 指定书签在书签层次结构中的位置。 |
WEB_URL | 用作链接标识符的唯一名称。书签的 URL HTTP 规范。 | 指定书签在书签层次结构中的位置并定义书签条目名称。对于 Web URL 链接,它指定 URL 地址。 |
指定在创建链接、字段、标记、附件、媒体或相关区域书签时,矩形区域的范围应基于当前元素的范围来确定,还是基于与当前元素相关联的单元的范围来确定。缺省值为 element_range。
以下常量适用于 action_range 关键字:
语法
ACTION_RANGE = <ELEMENT_RANGE | CELL_RANGE>
指定矩形区域(针对链接或相关区域书签)是采用当前单元或元素的范围来计算,还是基于所有匹配单元或元素范围的总和来计算。
以下常量适用于 action_instance 关键字:
语法
ACTION_INSTANCE = <SINGLE_INSTANCE | MULTIPLE_INSTANCE>
示例 1:
! Create a bookmark to a sheet in a document.
!
if (first_time eq true) then
if (sheet_name .ne. "details") then
action_item = bookmark
action_name = "details"
action_type = document
action_spec = "./Drawing Sheet"
endif
endif
示例 2:
! In the Table of Contents sheet, link
! all text in the index to the corresponding
! sheet name in the document.
if (sheet_name eq "Table of Contents") then
if ((type eq text) and (color eq 3)) then
! Define the rectangular region around the current
! text string that points/links to the corresponding
! sheet in the document by the same name.
action_item = link
action_name = characters
action_type = document
action_spec = characters
endif
endif
示例 3:
! Create a bookmark to the equipment
! items and associate a maintenance video with
! the appropriate equipment.
! Identify the type of equipment to be addressed
if ((type eq 2) and (cellname eq "Sprinkler Head")) then
! Identify the tag set
tag_set="equipment information"
tag_name="serial number"
! Define a Bookmark under the sheetname for this page
! that will navigate to the piece of equipment. Use the
! sheet_name and TAG_CHAR to form the action item name.
action_item = bookmark
action_name = sheet_name + "." + TAG_CHAR
action_type = AREA_OF_INTEREST
action_spec = "." + sheet_name + "./" + TAG_CHAR
! Define a multimedia sound clip that describes
! how to install the equipment.
action_item = media
action_name = "Maintenance Instructions"
action_type = PLAY_MEDIA
action_spec = "c:\equipment\videos\sprinkler.wav"
endif
以下关键字可用作赋值语句,first_time 关键字除外。
语法
sheet_name = string
语法
ignore_engineering_links = <TRUE|FALSE>
语法
bookmark_template = file specification to an XML file
语法
zoom_percentage = integer (where 100 is 100%)
示例:
if (first_time eq true) then
! Load the bookmark template
bookmark_template = "d:\anystreet\mybookmarktemplate.xml"
if (cellname eq "steps") then
action_item = BOOKMARK
action_name = "Step Detail"
zoom_percentage = 150
action_type = AREA_OF_INTEREST
action_spec = "./details/steps"
endif
以下关键字用于将对象元数据发布到 PDF。要在 PDF 文档中查看对象元数据,请单击 Adobe Acrobat 或 Reader 中的“模型树”。
语法:
propertycontainer_name = "string"
语法:
property_name = "string"
语法:
property_setvalues = "attribute = value"
property_setvalues = "attribute1 = value1;attribute2 = value2"
语法:
property_maptoelement = true
property_maptoelement = false
语法:
property_setqueryvalues = "string"
语法:
property_getvalue ="string"
语法:
property_deleteattributes = "string"
property_deleteattributes = "string1;string2"
示例 1:
!Specify property name, set property values,
!delete property value, and map to element.
propertycontainer_name = "Ward 1"
if ((type eq shape) and (level_name eq 'ward 1')) then
property_name = "Ward 1"
property_setvalues = "City=Dacula"
property_setvalues = "Ward Name=Otonabee;Ward Zone=1"
property_setvalues = "Mayor=J. Doe"
Property_SetValues = "Useless=Stuff"
!Delete property value
Property_DeleteAttributes = "Useless"
property_maptoelement = true
endif
! Set up Ward 2
propertycontainer_name = "Ward 2"
if ((type eq shape) and (level_name eq 'ward 2')) then
property_name = "Ward 2"
property_setvalues = "City=Snellville"
property_setvalues = "Ward Name=Wantonabee;Ward Zone=2"
property_setvalues = "Mayor=J. Smith"
property_maptoelement = true
endif
下图显示了如何在 Adobe Reader/Acrobat 模型树中显示 propertycontainer_name 关键字值(Ward 1 和 Ward 2)。此外请注意,Useless 属性 (property_setvalues = "Useless=Stuff") 不会显示在模型树中,因为它已被删除 (Property_DeleteAttributes = "Useless")。
示例 2:
! Query an object's attribute value.
if (type == line) then
property_name = "Ward 1"
property_setqueryvalues = "City"
if (property_getvalue=="Dacula")
color = "red"
endif
endif