Loading...
Searching...
No Matches
pdftron::PDF::Annots::Text Class Reference

`#include <Text.h>`

Inheritance diagram for pdftron::PDF::Annots::Text:

## Public Types
enum | Icon { e_Comment , e_Key , e_Help , e_NewParagraph , e_Paragraph , e_Insert , e_Note , 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
| Text (SDF::Obj d=0)
| Text (const Annot &ann)
bool | IsOpen () const
void | SetOpen (bool isopen)
Icon | GetIcon () const
const char * | GetIconName () const
void | SetIcon (Icon icon=e_Note)
void | SetIcon (const char *icon)
UString | GetState () const
void | SetState (const UString &state="")
UString | GetStateModel () const
void | SetStateModel (const UString &sm)
Point | GetAnchorPosition () const
void | SetAnchorPosition (const Point &pt)
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 Text | Create (SDF::SDFDoc &doc, const Rect &pos, const UString &contents=UString(""))
static Text | CreateAnnot (SDF::SDFDoc &doc, const Rect &pos, const UString &contents=UString(""))
static Text | Create (SDF::SDFDoc &doc, const Point &pos, const UString &contents=UString(""))
static Text | CreateAnnot (SDF::SDFDoc &doc, const Point &pos, const UString &contents=UString(""))
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)

## Detailed Description

A text annotation represents a "sticky note" attached to a point in the PDF document. When closed, the annotation shall appear as an icon; when open, it shall display a pop-up window containing the text of the note in a font and size chosen by the conforming reader. Text annotations do not scale and rotate with the page (i.e. they should behave as if the NoZoom and NoRotate annotation flags).

Definition at line 21 of file Text.h.

## Member Enumeration Documentation

## ◆ Icon

enum pdftron::PDF::Annots::Text::Icon

Icon enumeration defines the type of icon associated with the Text annotation.

Enumerator
e_Comment | comment icon
e_Key | key icon
e_Help | Help icon.
e_NewParagraph | New Paragraph icon.
e_Paragraph | Paragraph icon.
e_Insert | Insert icon.
e_Note | Note icon.
e_Unknown | Unknown, no icon associated or non-standard icon.

Definition at line 100 of file Text.h.

## Constructor & Destructor Documentation

## ◆ Text() [1/2]

pdftron::PDF::Annots::Text::Text | ( | SDF::Obj | d = 0 | ) |

Creates a Text annotation and initializes it using given Cos/SDF object.

Parameters

  d | The 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.

## ◆ Text() [2/2]

pdftron::PDF::Annots::Text::Text | ( | const Annot & | ann | ) |
| inline

Creates a Text annotation and initializes it using given annotation object.

Parameters

  ann | Annot object used to initialize the Text annotation.

Note
  The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Definition at line 38 of file Text.h.

## Member Function Documentation

## ◆ Create() [1/2]

Text pdftron::PDF::Annots::Text::Create | ( | SDF::SDFDoc & | doc,
|  | const Point & | pos,
|  | const UString & | contents = UString("") )
| static

Creates a new Text annotation in the specified document.

Parameters

  doc | A document to which the annotation is added.
  pos | A point specifying the annotation's location in default user space units. This determines the location of bottom left corner of the annotation's icon.
  contents | The text of the annotation, that shall be displayed in its popup window.

Returns
  A newly created Text annotation.

## ◆ Create() [2/2]

Text pdftron::PDF::Annots::Text::Create | ( | SDF::SDFDoc & | doc,
|  | const Rect & | pos,
|  | const UString & | contents = UString("") )
| static

Creates a new Text annotation in the specified document.

Parameters

  doc | A document to which the annotation is added.
  pos | A rectangle specifying the annotation's bounds in default user space units.

Returns
  A newly created blank Text annotation. Creates a new Text annotation in the specified document.

Parameters

  doc | A document to which the annotation is added.
  pos | A rectangle specifying the annotation's bounds in default user space units.
  contents | The text of the annotation, that shall be displayed in its popup window.

Returns
  A newly created Text annotation.

## ◆ CreateAnnot() [1/2]

Text pdftron::PDF::Annots::Text::CreateAnnot | ( | SDF::SDFDoc & | doc,
|  | const Point & | pos,
|  | const UString & | contents = UString("") )
| static

## ◆ CreateAnnot() [2/2]

Text pdftron::PDF::Annots::Text::CreateAnnot | ( | SDF::SDFDoc & | doc,
|  | const Rect & | pos,
|  | const UString & | contents = UString("") )
| static

## ◆ GetAnchorPosition()

Point pdftron::PDF::Annots::Text::GetAnchorPosition | ( |  | ) | const

Returns anchor point position (in relative coordinates) - the point that won't move when the page is zoomed in/out Anchor point position is in relative coordinates [0,1], and default is upper-left corner (0,1)

Returns
  Currently stored anchor position or the default (upper-left corner (0,1))

## ◆ GetIcon()

Icon pdftron::PDF::Annots::Text::GetIcon | ( |  | ) | const

Returns the type of the icon associated with the Text annotation.

Returns
  A value of the enumeration type "Icon". Default value: e_Note.

Note
  The annotation's appearance stream, if present, will take precedence over this entry.

## ◆ GetIconName()

const char * pdftron::PDF::Annots::Text::GetIconName | ( |  | ) | const

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

Returns
  A string denoting the name of the icon.

Note
  The following icon names are equivalent to predefined icon types from the enum "Icon": "Comment" = e_Comment "Key" = e_Key "Help" = e_Help "NewParagraph" = e_NewParagraph "Paragraph" = e_Paragraph "Insert" = e_Insert "Note" = e_Note "Unknown" = e_Unknown Names other than mentioned above do not have predefined icon appearances.
  The annotation's appearance stream, if present, will take precedence over this entry.

## ◆ GetState()

UString pdftron::PDF::Annots::Text::GetState | ( |  | ) | const

Returns the string indicating the state of the Text annotation. (PDF 1.5)

Returns
  A string that indicates the state of the Text annotation when first loaded.
  Default: "Unmarked" if StateModel is "Marked"; "None" if StateModel is "Review".

## ◆ GetStateModel()

UString pdftron::PDF::Annots::Text::GetStateModel | ( |  | ) | const

Returns the string indicating the state model of the Text annotation. (PDF 1.5)

Returns
  A string containing the state model name - either "Marked" or "Review".

## ◆ IsOpen()

bool pdftron::PDF::Annots::Text::IsOpen | ( |  | ) | const

Returns the initial status of the Text annotation.

Returns
  A boolean value that specifies whether the annotation shall initially be displayed as opened. Default value: false.

## ◆ SetAnchorPosition()

void pdftron::PDF::Annots::Text::SetAnchorPosition | ( | const Point & | pt | ) |

Sets anchor point position (in coordinates relative to the annotation Rect) - the point that won't move when the page is zoomed in/out and/or if the page is rotated.

Parameters

  pt | Anchor point position in relative coordinates [0,1], where 0,0 is bottom left corner of the annotation, and 1,1 is top right corner. Default: 0,1

## ◆ SetIcon() [1/2]

void pdftron::PDF::Annots::Text::SetIcon | ( | const char * | icon | ) |

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

Parameters

  icon | A string denoting the name of the icon.

Note
  The following icon names are equivalent to predefined icon types from the enum "Icon": "Comment" = e_Comment "Key" = e_Key "Help" = e_Help "NewParagraph" = e_NewParagraph "Paragraph" = e_Paragraph "Insert" = e_Insert "Note" = e_Note "Unknown" = e_Unknown Names other than mentioned above do not have predefined icon appearances.
  The annotation's appearance stream, if present, will take precedence over this entry.

## ◆ SetIcon() [2/2]

void pdftron::PDF::Annots::Text::SetIcon | ( | Icon | icon = e_Note | ) |

Sets the type of the icon associated with the Text annotation. (Optional)

Parameters

  icon | A value of the enum "Icon" type. Default value: e_Note.

Note
  The annotation's appearance stream, if present, will take precedence over this entry.

## ◆ SetOpen()

void pdftron::PDF::Annots::Text::SetOpen | ( | bool | isopen | ) |

Sets the initial status of the Text annotation. (Optional)

Parameters

  isopen | A boolean value that specifies whether the annotation shall initially be displayed as opened. Default value: false.

## ◆ SetState()

void pdftron::PDF::Annots::Text::SetState | ( | const UString & | state = "" | ) |

Sets the string indicating the state of the Text annotation. (Optional; PDF 1.5 )

Parameters

  state | A string that indicates the state of the Text annotation when first loaded. Default: "Unmarked" if StateModel is "Marked"; "None" if StateModel is "Review".

## ◆ SetStateModel()

void pdftron::PDF::Annots::Text::SetStateModel | ( | const UString & | sm | ) |

Sets the string indicating the state model of the Text annotation. (Required if State is present, otherwise optional; PDF 1.5 )

Parameters

  sm | A string containing the state model name - either "Marked" or "Review".

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

- PDF/Annots/Text.h