pdftron::PDF::Annots::Text Class Reference

A text annotation represents a "sticky note" attached to a point in the PDF document. More...

#include <Text.h>

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

Inheritance graph
[legend]
Collaboration diagram for pdftron::PDF::Annots::Text:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Icon {
  e_Comment, e_Key, e_Help, e_NewParagraph,
  e_Paragraph, e_Insert, e_Note, e_Unknown
}
 Icon enumeration defines the type of icon associated with the Text annotation. More...

Public Member Functions

 Text (SDF::Obj d=0)
 Creates a Text annotation and initializes it using given Cos/SDF object.
 Text (const Annot &mku)
 Creates a Text annotation and initializes it using given annotation object.
bool IsOpen () const
 Returns the initial status of the Text annotation.
void SetOpen (bool isopen)
 Sets the initial status of the Text annotation.
Icon GetIcon () const
 Returns the type of the icon associated with the Text annotation.
const char * GetIconName () const
 Returns the name of the icon associated with the Text annotation.
void SetIcon (Icon icon=e_Note)
 Sets the type of the icon associated with the Text annotation.
void SetIcon (const char *icon)
 Sets the name of the icon associated with the Text annotation.
UString GetState () const
 Returns the string indicating the state of the Text annotation.
void SetState (const UString &state="")
 Sets the string indicating the state of the Text annotation.
UString GetStateModel () const
 Returns the string indicating the state model of the Text annotation.
void SetStateModel (const UString &sm)
 Sets the string indicating the state model of the Text annotation.

Static Public Member Functions

static Text Create (SDF::SDFDoc &doc, const Rect &pos, const UString &contents=UString(""))
 Creates a new Text annotation in the specified document.
static Text Create (SDF::SDFDoc &doc, const Point &pos, const UString &contents=UString(""))
 Creates a new Text annotation in the specified document.


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).


Member Enumeration Documentation

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.


Constructor & Destructor Documentation

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

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

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

pdftron::PDF::Annots::Text::Text ( const Annot mku  )  [inline]

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

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


Member Function Documentation

static 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.

static 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.
contents The text of the annotation, that shall be displayed in its popup window.
Returns:
A newly created Text annotation.

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.

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.

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.

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.

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.

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.

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”.

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”.

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".

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".


© 2002-2010 PDFTron Systems Inc.