public class FileAttachment extends Markup
Annot.BorderStyle
Modifier and Type | Field and Description |
---|---|
static int |
e_Graph
For each FileAttachment annotation, one can specify the icon
used to display the annotation by choosing one of the entries
the following integer list.
|
static int |
e_Paperclip
The Constant e_Paperclip.
|
static int |
e_PushPin
The Constant e_PushPin.
|
static int |
e_Tag
The Constant e_Tag.
|
static int |
e_Unknown
The Constant e_Unknown.
|
e_3D, e_action_trigger_activate, e_action_trigger_annot_blur, e_action_trigger_annot_down, e_action_trigger_annot_enter, e_action_trigger_annot_exit, e_action_trigger_annot_focus, e_action_trigger_annot_page_close, e_action_trigger_annot_page_invisible, e_action_trigger_annot_page_open, e_action_trigger_annot_page_visible, e_action_trigger_annot_up, e_Caret, e_Circle, e_down, e_FileAttachment, e_FreeText, e_hidden, e_Highlight, e_Ink, e_invisible, e_Line, e_Link, e_locked, e_locked_contents, e_Movie, e_no_rotate, e_no_view, e_no_zoom, e_normal, e_Polygon, e_Polyline, e_Popup, e_print, e_PrinterMark, e_Projection, e_read_only, e_Redact, e_RichMedia, e_rollover, e_Screen, e_Sound, e_Square, e_Squiggly, e_Stamp, e_StrikeOut, e_Text, e_toggle_no_view, e_TrapNet, e_Underline, e_Watermark, e_Widget
Constructor and Description |
---|
FileAttachment()
Creates an empty FileAttachment annotation.
|
FileAttachment(Annot annot)
Creates an FileAttachment annotation and initialize it using given annotation object.
|
FileAttachment(Obj d)
Creates an FileAttachment annotation and initialize it using given Cos/SDF object.
|
Modifier and Type | Method and Description |
---|---|
static FileAttachment |
create(Doc doc,
Rect pos,
java.lang.String path)
Creates a file attachment annotation.
|
static FileAttachment |
create(Doc doc,
Rect pos,
java.lang.String path,
java.lang.String icon_name)
Creates FileAttachment
|
void |
export()
The function saves the data referenced by this File Attachment to an
external file.
|
void |
export(java.lang.String save_as)
The function saves the data referenced by this File Attachment to an
external file.
|
FileSpec |
getFileSpec()
Get the file specification.
|
int |
getIcon()
Get the icon type as an entry of the enum "Icon".
|
java.lang.String |
getIconName()
Get the icon type as a string.
|
void |
SetFileSpec(FileSpec file)
Set the file specification.
|
void |
setIcon(int type)
Set the icon type using an entry of the enum "Icon".
|
void |
SetIconName(java.lang.String icon)
Set the icon type using a string.
|
getBorderEffect, getBorderEffectIntensity, getContentRect, getCreationDates, getInteriorColor, getInteriorColorCompNum, getOpacity, getPadding, getPopup, getSubject, getTitle, setBorderEffect, SetBorderEffectIntensity, setContentRect, setCreationDates, setInteriorColor, setOpacity, SetPadding, setPopup, setSubject, setTitle
__Create, __GetHandle, __GetRefHandle, create, equals, flatten, getActiveAppearanceState, getAppearance, getAppearance, getAppearance, getBorderStyle, getColorAsCMYK, getColorAsGray, getColorAsRGB, getColorCompNum, getContents, getDate, getFlag, getOptionalContent, getPage, getRect, getRotation, getSDFObj, GetStructParent, getTriggerAction, getType, getUniqueID, getVisibleContentBox, isMarkup, isValid, refreshAppearance, removeAppearance, resize, setActiveAppearanceState, setAppearance, setAppearance, setAppearance, setBorderStyle, setColor, setContents, setDate, setFlag, setOptionalContent, setPage, setRect, setRotation, setStructParent, setUniqueID
public static final int e_Graph
public static final int e_PushPin
public static final int e_Paperclip
public static final int e_Tag
public static final int e_Unknown
public FileAttachment(Obj d)
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
d
- the input Cos/SDF objectpublic FileAttachment()
public FileAttachment(Annot annot) throws PDFNetException
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
annot
- input annotation objectPDFNetException
public static FileAttachment create(Doc doc, Rect pos, java.lang.String path, java.lang.String icon_name) throws PDFNetException
doc
- A document to which the annotation is added.pos
- A rectangle specifying the annotation's bounds, in user space coordinates.path
- path to the referenced fileicon_name
- the The name of an icon to be used in displaying the annotation, default is PushPin.PDFNetException
public static FileAttachment create(Doc doc, Rect pos, java.lang.String path) throws PDFNetException
Note: PDF Viewer applications should provide predefined icon appearances for at least the following standard names: Graph PushPin Paperclip Tag. Additional names may be supported as well. Default value: PushPin.
doc
- A document to which the annotation is added.pos
- A rectangle specifying the annotation's bounds, specified in
user space coordinates.path
- the pathPDFNetException
public void export(java.lang.String save_as) throws PDFNetException
save_as
- An optional parameter indicating the filepath and filename
where the data should be saved. If this parameter is not specified the function
will attempt to save the file using FileSpec.GetFilePath().PDFNetException
public void export() throws PDFNetException
PDFNetException
public FileSpec getFileSpec() throws PDFNetException
PDFNetException
public void SetFileSpec(FileSpec file) throws PDFNetException
file
- The file associated with this annotation.PDFNetException
public int getIcon() throws PDFNetException
Note: The entry specifies the name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the following standard names: GraphPushPin PaperclipTag Additional names may be supported as well. Default value: PushPin. The annotation dictionary's Appearance(AP) entry, if present, shall take precedence over the this entry
PDFNetException
public void setIcon(int type) throws PDFNetException
Note: The entry specifies the name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the following standard names: GraphPushPin PaperclipTag Additional names may be supported as well. Default value: PushPin. The annotation dictionary's Appearance(AP) entry, if present, shall take precedence over the this entry
type
- The enum "Icon" entry associated with this FileAttachment annotation.PDFNetException
public java.lang.String getIconName() throws PDFNetException
Note: the string spedifies the name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the following standard names: GraphPushPin PaperclipTag Additional names may be supported as well. Default value: PushPin. The annotation dictionary's Appearance(AP) entry, if present, shall take precedence over the this entry
PDFNetException
public void SetIconName(java.lang.String icon) throws PDFNetException
Note: the string spedifies the name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the following standard names: GraphPushPin PaperclipTag Additional names may be supported as well. Default value: PushPin. The annotation dictionary's Appearance(AP) entry, if present, shall take precedence over the this entry
icon
- The string specifying the icon type associated with this
FileAttachment annotation.PDFNetException