All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pdftron::PDF::Annots::FileAttachment Class Reference

#include <FileAttachment.h>

+ Inheritance diagram for pdftron::PDF::Annots::FileAttachment:

Public Types

enum  Icon {
  e_Graph, e_PushPin, e_Paperclip, e_Tag,
  e_Unknown
}
 
- Public Types inherited from pdftron::PDF::Annots::Markup
enum  BorderEffect { e_None, e_Cloudy }
 
- Public Types inherited from pdftron::PDF::Annot
enum  Type {
  e_Text, e_Link, e_FreeText, e_Line,
  e_Square, e_Circle, e_Polygon, e_Polyline,
  e_Highlight, e_Underline, e_Squiggly, e_StrikeOut,
  e_Stamp, e_Caret, e_Ink, e_Popup,
  e_FileAttachment, e_Sound, e_Movie, e_Widget,
  e_Screen, e_PrinterMark, e_TrapNet, e_Watermark,
  e_3D, e_Redact, e_Projection, e_RichMedia,
  e_Unknown
}
 
enum  Flag {
  e_invisible, e_hidden, e_print, e_no_zoom,
  e_no_rotate, e_no_view, e_read_only, e_locked,
  e_toggle_no_view, e_locked_contents
}
 
enum  ActionTriggerEvent {
  e_action_trigger_activate = 0, e_action_trigger_annot_enter = 1, e_action_trigger_annot_exit = 2, e_action_trigger_annot_down = 3,
  e_action_trigger_annot_up = 4, e_action_trigger_annot_focus = 5, e_action_trigger_annot_blur = 6, e_action_trigger_annot_page_open = 7,
  e_action_trigger_annot_page_close = 8, e_action_trigger_annot_page_visible = 9, e_action_trigger_annot_page_invisible = 10
}
 
enum  AnnotationState { e_normal, e_rollover, e_down }
 
typedef pdftron::PDF::BorderStyle BorderStyle
 

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)
 
Annotoperator= (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 Create (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 AnnotCreateInternal (ptrdiff_t impl)
 

Detailed Description

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.

Member Enumeration Documentation

Icon style

Enumerator
e_Graph 

The icon has graph appearance.

e_PushPin 

The icon has a push pin appearance.

e_Paperclip 

The icon has a paper clip appearance.

e_Tag 

The icon has tag appearance.

e_Unknown 

The icon has unrecognized appearance type.

Definition at line 23 of file FileAttachment.h.

Constructor & Destructor Documentation

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

Parameters
dThe Cos/SDF object to initialze the annotation with.
Note
The constructor does not copy any data, but is instead the logical equivalent of a type cast.
pdftron::PDF::Annots::FileAttachment::FileAttachment ( const Annot ann)
inline

Creates an FileAttachment annotation and initializes it using given annotation object.

Parameters
annAnnot object used to initialize the FileAttachment annotation.
Note
The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Definition at line 47 of file FileAttachment.h.

Member Function Documentation

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.

Parameters
docA document to which the annotation is added.
posA rectangle specifying the annotation's bounds, in user space coordinates.
fsa file specification object used to initialize the file attachment annotation.
icon_nameThe name of an icon to be used in displaying the annotation, default is PushPin.
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.
Returns
A new file attachment annotation.
static FileAttachment pdftron::PDF::Annots::FileAttachment::Create ( SDF::SDFDoc doc,
const Rect pos,
const UString 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.

Parameters
docA document to which the annotation is added.
posA rectangle specifying the annotation's bounds, in user space coordinates.
pathThe path to the file which should be attached
icon_nameAn icon to be used in displaying the annotation, default is PushPin.
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.
Returns
A new file attachment annotation.
static FileAttachment pdftron::PDF::Annots::FileAttachment::Create ( SDF::SDFDoc doc,
const Rect pos,
const UString 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.

Parameters
docA document to which the annotation is added.
posA rectangle specifying the annotation's bounds, in user space coordinates.
pathThe path to the file which should be attached
icon_nameThe name of an icon to be used in displaying the annotation.
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.
Returns
A new file attachment annotation.
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.

Parameters
save_asAn 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().
Returns
true is the file was saved successfully, false otherwise.
FileSpec pdftron::PDF::Annots::FileAttachment::GetFileSpec ( ) const
Returns
the file specification that contains a file reference or the embedded file data stream.
Icon pdftron::PDF::Annots::FileAttachment::GetIcon ( ) const
Returns
the type the associated icon style. e_PushPin
Note
The annotation dictionary's appearance stream, if present, will take precedence over this entry when displaying the annotation in the viewer.
const char* pdftron::PDF::Annots::FileAttachment::GetIconName ( ) const

Returns the name of the icon associated with the FileAttachment annotation.

Returns
A string denoting the name of the icon.
See Also
GetIcon() GetIconName() returns the icon name as it appears in the annotation dictionary, while GetIcon() returns the same icon name converted to enumeration value.
Note
The annotation dictionary's appearance stream, if present, will take precedence over this entry when displaying the annotation in the viewer.
void pdftron::PDF::Annots::FileAttachment::SetFileSpec ( const FileSpec file)

Sets the file specification.

Parameters
fileThe file specification to associate with this annotation.. The file specification contains a file reference or the embedded file data stream.
void pdftron::PDF::Annots::FileAttachment::SetIcon ( Icon  type = e_PushPin)

Sets the icon style associated with FileAttachment annotation. (Optional)

Parameters
typeicon style. e_PushPin
Note
The annotation dictionary's appearance stream, if present, will take precedence over this entry when displaying the annotation in the viewer.
void pdftron::PDF::Annots::FileAttachment::SetIconName ( const char *  iname)

Sets the name of the icon associated with the FileAttachment annotation. (Optional)

Parameters
inameA string.denoting the name of the icon.
Note
this method should be used to assign non-standard icon type to the annotation.
See Also
SetIcon()
Note
The annotation dictionary's appearance stream, if present, will take precedence over this entry when displaying the annotation in the viewer.

The documentation for this class was generated from the following file: