Attachments
Using attachments, you can embed files, sound, and movies inside a PDF document.
File Attachments
This feature lets you attach and embed files inside a PDF document. The attached files can be text files, HTML files, Microsoft Word files, or even Microsoft Excel spreadsheets. For all attachments, you should set the action_item keyword to attachment. The action_name keyword specifies a unique name for the attachment and also serves as a tooltip when you pause the mouse over the attachment.
When you create a file attachment, you must set the action_type keyword to file_attachment. The action_spec keyword specifies the file specification for the attachment. The software defines a rectangular region with a sticky note icon, so that you can double-click the icon to view the attached file. When you double-click the icon, the application associated with the attachment’s extension (mime-type) displays the attachment. The viewer application may post a warning dialog message about potentially unsafe attachments.
The size of the sticky note icon remains the same size even if the view's zoom factor is greater than 100%. You can scale down the size of the icon by setting the zoom factor less than 100%. This behavior could be a cue to you that the icon is not part of the drawing.
The following table displays the required/default values for the action keywords when you create a file attachment.
Keyword | Value | Default Value |
---|---|---|
action_item | ATTACHMENT | Required |
action_name | Unique name for the attachment. | This value is required and is used as the tooltip when you pause the mouse over the icon. |
action_type | FILE_ATTACHMENT | Required |
action_spec | File specification | Required |
action_range | ELEMENT_RANGE | CELL_RANGE | ELEMENT_RANGE |
action_instance | SINGLE_INSTANCE | SINGLE_INSTANCE |
Example:
! Attach an HTML file, and create a bookmark to it. ! if ((sheet_name eq "AR1") and (color eq 7) and (weight eq 2)) then ! File Attachment action_item = attachment action_name = "Base Slab Dimensions" action_type = FILE_ATTACHMENT action_spec = "c:\manhole\slab.htm" action_item = bookmark action_name = "Base Slab Dimensions" action_type = AREA_OF_INTEREST action_spec = "./attachments" endif
The design script example above creates the following file attachment and bookmark.
Movie and Sound Attachments
This feature lets you attach and embed movie and sound files inside a PDF document. For all attachments, you should set the action_item keyword to attachment. The action_name keyword specifies a unique name for the attachment and also serves as a tooltip. The tooltip displays when you pause the mouse over the attachment.
When you create a sound attachment, you must set the action_type keyword to sound_attachment. For movie attachments, you set the action_type keyword to movie_attachment.
The action_spec keyword specifies the file specification for the sound or movie file. The software defines a rectangular region with an icon, so that you can double-click the icon to play the attached file. Double-clicking the icon brings up an external multimedia application to play the movie or sound clip. Acrobat viewer invokes the external application based on the mime-type associated with the attachment’s file extension. The Acrobat viewer application may post a warning dialog message about potentially unsafe attachments.
The following table displays the required/default values for the action keywords when you create a movie/sound attachment.
Keyword | Value | Default Value |
---|---|---|
action_item | ATTACHMENT | Required |
action_name | Unique name for attachment. | This value is required and is used as the tooltip when you pause the mouse over the icon. |
action_type | MOVIE_ATTACHMENT / SOUND_ATTACHMENT | Required |
action_spec | Movie / sound file specification | Required |
action_range | ELEMENT_RANGE | CELL_RANGE | ELEMENT_RANGE |
action_instance | SINGLE_INSTANCE | SINGLE_INSTANCE |
Example:
! Attach a sound file, and create a bookmark to it. ! if ((type eq line) and (color eq 8) and (weight eq 2)) then ! Sound Attachment action_item = attachment action_name = "Sound Clip" action_type = SOUND_ATTACHMENT action_spec = "d:\manhole\dave.wav" ! Create a bookmark to the sound file. action_item = bookmark action_name = "Play sound clip" action_type = AREA_OF_INTEREST action_spec = "./Sound Attachments" endif
The design script example above creates the following Sound attachment and bookmark.