Foxit PDF SDK
fsdk.FileAttachment Class Reference

Public Member Functions

def GetFileSpec ()
 Get the file specification.
More...
 
def GetIconName ()
 Get icon name.
More...
 
def SetFileSpec (file_spec)
 Set a file specification, which should specify an embedded file.
More...
 
def SetIconName (icon_name)
 Set icon name.
More...
 

Detailed Description

A file attachment annotation contains a reference to a file, which typically is embedded in the PDF file.
File attachment annotation is a kind of markup annotation, so class FileAttachment is derived from class Markup , and also offers functions to get/set file attachment annotation's properties and reset appearance stream of a file attachment annotation.

Note
For a newly created file attachment annotation, if user calls function fsdk.Annot.ResetAppearanceStream directly without setting any properties, the default appearance will be used:
border color = 0xFFFF0000 (red), opacity = 1.0, icon name = "PushPin".
See also
Markup

Member Function Documentation

◆ GetFileSpec()

def fsdk.FileAttachment.GetFileSpec ( )

Get the file specification.

Returns
The file specification object. If the return value of function fsdk.FileSpec.IsEmpty for the returned file specification object is true, that means no file specification property can be found.

◆ GetIconName()

def fsdk.FileAttachment.GetIconName ( )

Get icon name.

This property has effect on file attachment annotation's appearance. File attachment annotation has predefined standard icon names:
"Graph", "PushPin", "Paperclip", "Tag".
An empty icon name string means current File attachment annotation would be treated as "PushPin".

Returns
Icon name string.

◆ SetFileSpec()

def fsdk.FileAttachment.SetFileSpec (   file_spec)

Set a file specification, which should specify an embedded file.

Parameters
[in]file_specA valid file specification object to be set.
Returns
true means success, while false means failure.

◆ SetIconName()

def fsdk.FileAttachment.SetIconName (   icon_name)

Set icon name.

This property has effect on file attachment annotation's appearance. File attachment annotation has predefined standard icon names:
"Graph", "PushPin", "Paperclip", "Tag".
For a newly created file attachment annotation, if current function is not called, icon name will be "PushPin" by default.
If user wants the new icon name have effect on annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after setting the new icon name.

Parameters
[in]icon_nameNew icon name string to be set.
Returns
None.