#include <FileAttachment.h>
Public Member Functions | |
FileAttachment (SDF::Obj d=0) | |
FileAttachment (const Annot &ann) | |
FileSpec | GetFileSpec () const |
void | SetFileSpec (const FileSpec &file) |
bool | Export (const UString &save_as="") const |
Icon | GetIcon () const |
void | SetIcon (Icon type=e_PushPin) |
const char * | GetIconName () const |
void | SetIconName (const char *iname) |
Public Member Functions inherited from pdftron::PDF::Annots::Markup | |
Markup (SDF::Obj d=0) | |
Markup (const Annot &ann) | |
UString | GetTitle () |
void | SetTitle (const UString &title) |
void | SetTitle (const char *title) |
Popup | GetPopup () const |
void | SetPopup (const Popup &ppup) |
double | GetOpacity () const |
void | SetOpacity (double op) |
UString | GetSubject () const |
void | SetSubject (const UString &contents) |
Date | GetCreationDates () const |
void | SetCreationDates (const Date &dt) |
BorderEffect | GetBorderEffect () const |
void | SetBorderEffect (BorderEffect effect=e_None) |
double | GetBorderEffectIntensity () const |
void | SetBorderEffectIntensity (double intensity=0) |
ColorPt | GetInteriorColor () const |
int | GetInteriorColorCompNum () const |
void | SetInteriorColor (const ColorPt &c, int CompNum) |
Rect | GetContentRect () const |
void | SetContentRect (const Rect &cr) |
Rect | GetPadding () const |
void | SetPadding (const Rect &rd) |
void | SetPadding (double x) |
void | RotateAppearance (double angle) |
Public Member Functions inherited from pdftron::PDF::Annot | |
Annot (SDF::Obj d=0) | |
Annot (const Annot &d) | |
Annot & | operator= (const Annot &d) |
bool | operator== (const Annot &d) |
bool | IsValid () const |
SDF::Obj | GetSDFObj () const |
Type | GetType () const |
Rect | GetRect () const |
Rect | GetVisibleContentBox () const |
bool | IsMarkup () const |
void | SetRect (const Rect &pos) |
Page | GetPage () const |
void | SetPage (const Page &page) |
SDF::Obj | GetUniqueID () const |
void | SetUniqueID (const char *id, int id_buf_sz=0) |
Date | GetDate () const |
void | SetDate (const Date &date) |
bool | GetFlag (Flag flag) const |
void | SetFlag (Flag flag, bool value) |
SDF::Obj | GetTriggerAction (Annot::ActionTriggerEvent trigger) |
BorderStyle | GetBorderStyle () const |
void | SetBorderStyle (const BorderStyle &bs, bool oldStyleOnly=false) |
SDF::Obj | GetAppearance (AnnotationState annot_state=e_normal, const char *app_state=0) |
void | SetAppearance (SDF::Obj app_stream, AnnotationState annot_state=e_normal, const char *app_state=0) |
void | RemoveAppearance (AnnotationState annot_state=e_normal, const char *app_state=0) |
void | Flatten (class Page page) |
const char * | GetActiveAppearanceState () const |
void | SetActiveAppearanceState (const char *astate) |
ColorPt | GetColorAsRGB () const |
ColorPt | GetColorAsCMYK () const |
ColorPt | GetColorAsGray () const |
int | GetColorCompNum () const |
void | SetColor (const ColorPt &col, int numcomp=3) |
int | GetStructParent () const |
void | SetStructParent (const int parkeyval) |
SDF::Obj | GetOptionalContent () const |
void | SetOptionalContent (SDF::Obj content) |
void | SetContents (const UString &contents) |
UString | GetContents () const |
int | GetRotation () const |
void | SetRotation (int angle) |
void | RefreshAppearance () |
void | RefreshAppearance (const RefreshOptions &options) |
UString | GetCustomData (const UString &key) const |
void | SetCustomData (const UString &key, const UString &value) |
void | DeleteCustomData (const UString &key) |
void | Resize (const Rect &newrect) |
ptrdiff_t | GetHandleInternal () |
Static Public Member Functions | |
static FileAttachment | Create (SDF::SDFDoc &doc, const Rect &pos, FileSpec fs, Icon icon_name=e_PushPin) |
static FileAttachment | CreateAnnot (SDF::SDFDoc &doc, const Rect &pos, FileSpec fs, Icon icon_name=e_PushPin) |
static FileAttachment | Create (SDF::SDFDoc &doc, const Rect &pos, const UString &path, Icon icon_name=e_PushPin) |
static FileAttachment | CreateAnnot (SDF::SDFDoc &doc, const Rect &pos, const UString &path, Icon icon_name=e_PushPin) |
static FileAttachment | Create (SDF::SDFDoc &doc, const Rect &pos, const UString &path, const char *icon_name) |
Static Public Member Functions inherited from pdftron::PDF::Annot | |
static Annot | Create (SDF::SDFDoc &doc, Type type, const Rect &pos) |
static Annot * | CreateInternal (ptrdiff_t impl) |
A file attachment annotation contains a reference to a file, which may be embedded in the PDF document.
Definition at line 17 of file FileAttachment.h.
Icon style
Definition at line 23 of file FileAttachment.h.
pdftron::PDF::Annots::FileAttachment::FileAttachment | ( | SDF::Obj | d = 0 | ) |
Creates an FileAttachment annotation and initializes it using given Cos/SDF object. d Cos/SDF object used to initialize the FileAttachment annotation
d | The Cos/SDF object to initialze the annotation with. |
|
inline |
Creates an FileAttachment annotation and initializes it using given annotation object.
ann | Annot object used to initialize the FileAttachment annotation. |
Definition at line 47 of file FileAttachment.h.
|
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. 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 |
fs | a file specification object used to initialize the file attachment annotation. |
icon_name | The name of an icon to be used in displaying the annotation, default is 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. 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. |
|
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. |
path | The path to the file which should be attached |
icon_name | The name of an icon to be used in displaying the annotation. |
|
static |
|
static |
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(). |
FileSpec pdftron::PDF::Annots::FileAttachment::GetFileSpec | ( | ) | const |
Icon pdftron::PDF::Annots::FileAttachment::GetIcon | ( | ) | const |
const char* pdftron::PDF::Annots::FileAttachment::GetIconName | ( | ) | const |
Returns the name of the icon associated with the FileAttachment annotation.
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. |
Sets the icon style associated with FileAttachment annotation. (Optional)
type | icon style. e_PushPin |
void pdftron::PDF::Annots::FileAttachment::SetIconName | ( | const char * | iname | ) |
Sets the name of the icon associated with the FileAttachment annotation. (Optional)
iname | A string.denoting the name of the icon. |