java.lang.Object | |||
↳ | com.pdftron.pdf.Annot | ||
↳ | com.pdftron.pdf.annots.Markup | ||
↳ | com.pdftron.pdf.annots.FileAttachment |
A file attachment annotation (PDF 1.3) contains a reference to a file, which typically shall be embedded in the PDF file.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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. | |||||||||
int | e_Paperclip | The Constant e_Paperclip. | |||||||||
int | e_PushPin | The Constant e_PushPin. | |||||||||
int | e_Tag | The Constant e_Tag. | |||||||||
int | e_Unknown | The Constant e_Unknown. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pdftron.pdf.annots.Markup
| |||||||||||
From class
com.pdftron.pdf.Annot
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FileAttachment(Obj d)
Creates an FileAttachment annotation and initialize it using given Cos/SDF object.
| |||||||||||
FileAttachment()
Creates an empty FileAttachment annotation.
| |||||||||||
FileAttachment(Annot annot)
Creates an FileAttachment annotation and initialize it using given annotation object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
SetFileSpec(FileSpec file)
Set the file specification.
| ||||||||||
void |
SetIconName(String icon)
Set the icon type using a string.
| ||||||||||
static FileAttachment |
create(Doc doc, Rect pos, String path)
Creates a file attachment annotation.
| ||||||||||
static FileAttachment |
create(Doc doc, Rect pos, String path, String icon_name)
Creates a file attachment annotation.
| ||||||||||
void |
export()
The function saves the data referenced by this File Attachment to an
external file.
| ||||||||||
void |
export(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".
| ||||||||||
String |
getIconName()
Get the icon type as a string.
| ||||||||||
void |
setIcon(int type)
Set the icon type using an entry of the enum "Icon".
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pdftron.pdf.annots.Markup
| |||||||||||
From class
com.pdftron.pdf.Annot
| |||||||||||
From class
java.lang.Object
|
For each FileAttachment annotation, one can specify the icon used to display the annotation by choosing one of the entries the following integer list. e_GraphPushPin - The icon has a graph push pin appearance. e_PaperclipTag - The icon has a paper clip tag appearance. e_Unknow - Undefined.
The Constant e_Paperclip.
The Constant e_PushPin.
The Constant e_Tag.
The Constant e_Unknown.
Creates an FileAttachment annotation and initialize it using given Cos/SDF object.
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
d | the input Cos/SDF object |
---|
Creates an empty FileAttachment annotation.
Creates an FileAttachment annotation and initialize it using given annotation object.
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
annot | input annotation object |
---|
PDFNetException |
---|
Set the file specification.
file | The file associated with this annotation. |
---|
PDFNetException |
---|
Set the icon type using a string. (Optional)
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 |
---|
Creates a file attachment annotation. A file attachment annotation contains a reference to a file, which typically is embedded in the PDF file.
doc | A document to which the annotation is added. |
---|---|
pos | A rectangle specifying the annotation's bounds, in user space coordinates. Note that FileAttachment icons can differ in their appearance dimensions, so you may want to match these Rectangle dimensions or the aspect ratio to avoid a squished or stretched appearance: e_Graph: 40 x 40 e_PushPin: 28 x 40 e_Paperclip: 14 x 34 e_Tag: 40 x 32 |
path | The path to the file which should be attached |
PDFNetException |
---|
Creates a file attachment annotation. A file attachment annotation contains a reference to a file, which typically is embedded in the PDF file.
doc | A document to which the annotation is added. |
---|---|
pos | A rectangle specifying the annotation's bounds, in user space coordinates. Note that FileAttachment icons can differ in their appearance dimensions, so you may want to match these Rectangle dimensions or the aspect ratio to avoid a squished or stretched appearance: e_Graph: 40 x 40 e_PushPin: 28 x 40 e_Paperclip: 14 x 34 e_Tag: 40 x 32 |
path | The path to the file which should be attached |
icon_name | An icon to be used in displaying the annotation, default is PushPin. |
PDFNetException |
---|
The function saves the data referenced by this File Attachment to an external file. If the file is embedded, the function saves the embedded file. If the file is not embedded, the function will copy the external file.
PDFNetException |
---|
The function saves the data referenced by this File Attachment to an external file. If the file is embedded, the function saves the embedded file. If the file is not embedded, the function will copy the external file.
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 |
---|
Get the file specification.
PDFNetException |
---|
Get the icon type as an entry of the enum "Icon".
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 |
---|
Get the icon type as a string.
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 |
---|
Set the icon type using an entry of the enum "Icon". (Optional)
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 |
---|