![]() |
#include <FileAttachment.h>
Public Types | |
enum | Icon { e_Graph, e_PushPin, e_Paperclip, e_Tag, e_Unknown } |
Icon style. More... | |
Public Member Functions | |
FileAttachment (SDF::Obj d=0) | |
Creates an FileAttachment annotation and initializes it using given Cos/SDF object. | |
FileAttachment (const Annot &ann) | |
Creates an FileAttachment annotation and initializes it using given annotation object. | |
FileSpec | GetFileSpec () const |
void | SetFileSpec (const FileSpec &file) |
Sets the file specification. | |
bool | Export (const UString &save_as="") const |
The function saves the data referenced by this File Attachment to an external file. | |
Icon | GetIcon () const |
void | SetIcon (Icon type=e_PushPin) |
Sets the icon style associated with FileAttachment annotation. | |
const char * | GetIconName () const |
Returns the name of the icon associated with the FileAttachment annotation. | |
void | SetIconName (const char *icon) |
Sets the name of the icon associated with the FileAttachment annotation. | |
Static Public Member Functions | |
static FileAttachment | Create (SDF::SDFDoc &doc, const Rect &pos, FileSpec fs, Icon icon_name=e_PushPin) |
Creates a file attachment annotation. | |
static FileAttachment | Create (SDF::SDFDoc &doc, const Rect &pos, const char *path, Icon icon_name=e_PushPin) |
Creates a file attachment annotation. | |
static FileAttachment | Create (SDF::SDFDoc &doc, const Rect &pos, const char *path, const char *icon_name) |
Creates a file attachment annotation. |
pdftron::PDF::Annots::FileAttachment::FileAttachment | ( | SDF::Obj | d = 0 |
) |
Creates an FileAttachment annotation and initializes it using given Cos/SDF object.
pdftron::PDF::Annots::FileAttachment::FileAttachment | ( | const Annot & | ann | ) | [inline] |
Creates an FileAttachment annotation and initializes it using given annotation object.
static FileAttachment pdftron::PDF::Annots::FileAttachment::Create | ( | SDF::SDFDoc & | doc, | |
const Rect & | pos, | |||
FileSpec | fs, | |||
Icon | icon_name = e_PushPin | |||
) | [static] |
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. | |
icon_name | The name of an icon to be used in displaying the annotation, default is PushPin. |
static FileAttachment pdftron::PDF::Annots::FileAttachment::Create | ( | SDF::SDFDoc & | doc, | |
const Rect & | pos, | |||
const char * | path, | |||
Icon | icon_name = e_PushPin | |||
) | [static] |
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. | |
icon_name | The name of an icon to be used in displaying the annotation, default is PushPin. |
static FileAttachment pdftron::PDF::Annots::FileAttachment::Create | ( | SDF::SDFDoc & | doc, | |
const Rect & | pos, | |||
const char * | path, | |||
const char * | icon_name | |||
) | [static] |
Creates a file attachment annotation.
This method should be used when a nonstandard icon type is desired in the 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. | |
icon_name | The name of an icon to be used in displaying the annotation, default is PushPin. |
FileSpec pdftron::PDF::Annots::FileAttachment::GetFileSpec | ( | ) | const |
void pdftron::PDF::Annots::FileAttachment::SetFileSpec | ( | const FileSpec & | file | ) |
Sets the file specification.
file | The file specification to associate with this annotation.. The file specification contains a file reference or the embedded file data stream. |
bool pdftron::PDF::Annots::FileAttachment::Export | ( | const UString & | save_as = "" |
) | const |
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. If the file is not embedded and the external file can't be found, the function returns false.
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(). |
Icon pdftron::PDF::Annots::FileAttachment::GetIcon | ( | ) | const |
void pdftron::PDF::Annots::FileAttachment::SetIcon | ( | Icon | type = e_PushPin |
) |
Sets the icon style associated with FileAttachment annotation.
(Optional)
type | icon style. e_PushPin |
const char* pdftron::PDF::Annots::FileAttachment::GetIconName | ( | ) | const |
Returns the name of the icon associated with the FileAttachment annotation.
void pdftron::PDF::Annots::FileAttachment::SetIconName | ( | const char * | icon | ) |
Sets the name of the icon associated with the FileAttachment annotation.
(Optional)
icon | A string.denoting the name of the icon. |