Foxit::PDF::Annotations::FreeText Class Reference

Class to represent free text annotation. More...

Inherits Foxit::PDF::Annotations::IMarkup.

Public Member Functions

virtual Boolean IsMarkup ()
 Check if current annotation is a markup annotation. More...
 
virtual AnnotType GetType ()
 Get the type of current annotation. More...
 
virtual String^ GetContents ()
 Get the contents data. More...
 
virtual void SetContents (String^ content)
 Set the contents data. More...
 
virtual DateTimeGetModifiedTime ()
 Get the last modification time. More...
 
virtual void SetModifiedTime (DateTime^ modifiedTime)
 Set the last modification time. More...
 
virtual UInt32 GetFlags ()
 Get annotation flags. More...
 
virtual void SetFlags (UInt32 flags)
 Set annotation flags. More...
 
virtual String^ GetName ()
 Get annotation name string. More...
 
virtual void SetName (String^ name)
 Get annotation name string. More...
 
virtual RectFGetRect ()
 Get rectangle value. More...
 
virtual Boolean Move (RectF^ rect)
 Move current annotation to a new position specified by a rectangle. More...
 
virtual BorderInfoGetBorderInfo ()
 Get border information. More...
 
virtual void SetBorderInfo (BorderInfo^ border)
 Set border information. More...
 
virtual String^ GetTitle ()
 Get title string. More...
 
virtual void SetTitle (String^ title)
 Set title string. More...
 
virtual String^ GetSubject ()
 Get subject string. More...
 
virtual void SetSubject (String^ subject)
 Set subject string. More...
 
virtual float GetOpacity ()
 Get opacity value. More...
 
virtual void SetOpacity (float opacity)
 Set opacity value. More...
 
virtual String^ GetIntent ()
 Get intent name. More...
 
virtual void SetIntent (String^ intent)
 Set intent name. More...
 
virtual DateTimeGetCreationTime ()
 Get creation time. More...
 
virtual void SetCreationTime (DateTime^ creationTime)
 Set the creation time. More...
 
virtual PopupGetPopup ()
 Get related pop-up annotation. More...
 
virtual Int32 CountStates (Int32 stateModel)
 Count state annotations with specific state model, related to current markup annotation. More...
 
virtual NoteGetState (Int32 stateModel, Int32 index)
 Get a state annoation with specific state model, related to current markup annotation. More...
 
virtual NoteAddState (State state)
 Add a new state annotation. More...
 
virtual Boolean RemoveAllStates ()
 Remove all the state annotations. More...
 
virtual Int32 CountReplies ()
 Count reply annotations. More...
 
virtual NoteGetReply (Int32 index)
 Get a reply annotation by index. More...
 
virtual NoteAddReply ()
 Add a reply annotation to the end of reply annotation list. More...
 
virtual Boolean RemoveReply (Int32 index)
 Remove a reply annotation by index. More...
 
virtual Boolean RemoveAllReplies ()
 Remove all the reply annotations. More...
 
virtual Boolean IsGrouped ()
 Check whether current markup annotation is in a group or not. More...
 
virtual IMarkupGetGroupHeader ()
 Get the header annotation (as primary annotation) of the group which current markup annotation belongs to. More...
 
virtual List< IMarkup^ >^ GetGroupElements ()
 Get all the markup annotations (including current one) in the group which current markup annotation belongs to. More...
 
virtual Boolean Ungroup ()
 Ungroup current markup annotation from the group it belongs to. More...
 
Int32 GetAlignment ()
 Get alignment. More...
 
void SetAlignment (Int32 alignment)
 Set alignment. More...
 
DefaultAppearanceGetDefaultAppearance ()
 Get default appearance data. More...
 
void SetDefaultAppearance (DefaultAppearance^ defaultAP)
 Set default appearance data. More...
 
List< String^ >^ GetLineEndingStyles ()
 Get line ending styles of callout line. More...
 
void SetLineEndingStyles (String^ startingStyle, String^ endingStyle)
 Set line ending styles of callout line. More...
 
List< PointF^ >^ GetCalloutLinePoints ()
 Get points of callout line. More...
 
void SetCalloutLinePoints (PointF^ point1, PointF^ point2, PointF^ point3)
 Set points of callout line. More...
 
Boolean ResetApppearanceStream ()
 Reset(regenerate) the appearance stream. More...
 

Additional Inherited Members

- Properties inherited from Foxit::PDF::Annotations::IAnnot
Int64 pointer
 Pointer to a handle of PDF annotation object. This pointer is not useful outside this SDK. The application should not access the pointer to the handle of the PDF annotation object directly.
 

Detailed Description

Class to represent free text annotation.

A free text annotation (PDF 1.3) displays text directly on the page.

Member Function Documentation

virtual Note ^ Foxit::PDF::Annotations::FreeText::AddReply ( )
virtual

Add a reply annotation to the end of reply annotation list.

Markup annotations may have several reply annotations which are represented by note annotations. Usually, viewer applications should not display reply annotations individually but together in the form of threaded comments.

Returns
An Annotations::Note object that receives the new reply annotation. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual Note ^ Foxit::PDF::Annotations::FreeText::AddState ( State  state)
virtual

Add a new state annotation.

Markup annotations may have an author-specific state associated with them. The state is not specified in the annotation itself but in a separate note annotation that refers to the original annotation. When a note annotation represents a state annotation, this note annotation will not be displayed individually.

Parameters
[in]stateState value of the new state annotation. Please refer to enumeration Annotations::State and this should be one of its values.
Returns
An Annotations::Note object that receives the new state annotation. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter state is invalid.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual Int32 Foxit::PDF::Annotations::FreeText::CountReplies ( )
virtual

Count reply annotations.

Markup annotations may have several reply annotations which are represented by note annotations. Usually, viewer applications should not display reply annotations individually but together in the form of threaded comments.

Returns
The count of reply annotations related to current markup annotation.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual Int32 Foxit::PDF::Annotations::FreeText::CountStates ( Int32  stateModel)
virtual

Count state annotations with specific state model, related to current markup annotation.

Markup annotations may have an author-specific state associated with them. The state is not specified in the annotation itself but in a separate text annotation that refers to the original annotation. When a note annotation represents a state annotation, this note annotation will not be displayed individually.

Parameters
[in]stateModelThe state model. It should be one of following values:
Returns
The count of state with specific state model.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter stateModel is invalid.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

Int32 Foxit::PDF::Annotations::FreeText::GetAlignment ( )

Get alignment.

Returns
An integer value that indicates the alignment:
  • 0: Left-justified
  • 1: Centered
  • 2: Right-justified
If there is any error, this function will return -1.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no alignment property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
virtual BorderInfo ^ Foxit::PDF::Annotations::FreeText::GetBorderInfo ( )
virtual

Get border information.

Returns
A Annotations::BorderInfo object that receives the border information value. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no border property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

List<PointF^> ^ Foxit::PDF::Annotations::FreeText::GetCalloutLinePoints ( )

Get points of callout line.

Only when the intent name of a free text annotation is "FreeTextCallout", this free text annotation can have callout line points property. Callout line points property can have 2 or 3 points:

  • 2 points represent the starting and ending coordinates of the callout line.
  • 3 points represent the starting, knee point, and ending coordinates of the callout line.
Returns
A point array that receives the points of callout line. It would contains 2 or 3 points, and please refer to comment "Details" part for more details. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no callout line points property can be found.
ErrorCode::Unsupported means intent name of current freetext annotation is not "FreeTextCallout".
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
virtual String ^ Foxit::PDF::Annotations::FreeText::GetContents ( )
virtual

Get the contents data.

Contents data is the text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form. In either case, this text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes

Returns
A String object that receives the contents data. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no content data can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual DateTime ^ Foxit::PDF::Annotations::FreeText::GetCreationTime ( )
virtual

Get creation time.

Returns
A Foxit::DateTime object that receives the creation time data. If the property cannot be found or there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no creation time property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

DefaultAppearance ^ Foxit::PDF::Annotations::FreeText::GetDefaultAppearance ( )

Get default appearance data.

Default appearance data can be used in formatting text. This property is necessary for a free text annotation.

Returns
A PDF::DefaultAppearance object that receives the default appearance data. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no default appearance property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
virtual UInt32 Foxit::PDF::Annotations::FreeText::GetFlags ( )
virtual

Get annotation flags.

Returns
Value of flags. Please refer to enumeration Annotations::Flags and this would be one or combination of its values.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no flags property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual List<IMarkup^> ^ Foxit::PDF::Annotations::FreeText::GetGroupElements ( )
virtual

Get all the markup annotations (including current one) in the group which current markup annotation belongs to.

Markup annotations can be grouped. The group consists of a primary annotation and one or more subordinate annotations. Some entries in the primary annotation are treated as group attributes that should apply to the group as a whole; the corresponding entries in the subordinate annotations should be ignored. These entries are contents, last modification time, fill color/border color, title, pop-up annotation, creation time, subject, and open status.
Operations that manipulate any annotation in a group, such as movement, cut, and copy, should be treated by viewer applications as acting on the entire group.

Returns
A markup annotation array that receives all the markup annotations in the group. If current annotation does not belong to a group or there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means current annotation does not belong to any group.
ErrorCode::InvalidType means there is any non-markup annotation in the group which current annotation belongs to.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual IMarkup ^ Foxit::PDF::Annotations::FreeText::GetGroupHeader ( )
virtual

Get the header annotation (as primary annotation) of the group which current markup annotation belongs to.

Markup annotations can be grouped. The group consists of a primary annotation and one or more subordinate annotations. Some entries in the primary annotation are treated as group attributes that should apply to the group as a whole; the corresponding entries in the subordinate annotations should be ignored. These entries are contents, last modification time, fill color/border color, title, pop-up annotation, creation time, subject, and open status.
Operations that manipulate any annotation in a group, such as movement, cut, and copy, should be treated by viewer applications as acting on the entire group.

Returns
A Annotation::IMarkup object that receives the header annotation of the group which current markup annotation belongs to. If current annotation does not belong to a group or there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no header annotation can be found – that means current markup annotation does not belong to any group.
ErrorCode::InvalidType means the header annotation is not a markup annotation.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual String ^ Foxit::PDF::Annotations::FreeText::GetIntent ( )
virtual

Get intent name.

Intent name is a name describing the intent of the markup annotation. Intents allow viewer applications to distinguish between different uses and behaviors of a single markup annotation type. If this property string is not present or its value is the same as the annotation type, the annotation has no explicit intent and should behave in a generic manner in a viewer application.
Free text annotation has predefined intent names:

  • "FreeTextCallout"
  • "FreeTextTypewriter"
Returns
A String object that receives the intent name. If the property cannot be found or there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no intent name property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

List<String^> ^ Foxit::PDF::Annotations::FreeText::GetLineEndingStyles ( )

Get line ending styles of callout line.

Only when the intent name of a free text annotation is "FreeTextCallout", this free text annotation can have line ending styles property.

Returns
A String array that receives the line ending styles of the start point and end point of the callout line. There would be 2 elements in this array: first one is for start point, and the second one is for the end point.
Each element would be one of following values: "None", "Square", "Circle", "Diamond", "OpenArrow", "ClosedArrow", "Butt", "ROpenArrow", "RClosedArrow", "Slash". If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no line ending styles property can be found.
ErrorCode::Unsupported means intent name of current freetext annotation is not "FreeTextCallout".
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
virtual DateTime ^ Foxit::PDF::Annotations::FreeText::GetModifiedTime ( )
virtual

Get the last modification time.

Returns
A Foxit::DateTime object that receives the last modification time. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no modified time data can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual String ^ Foxit::PDF::Annotations::FreeText::GetName ( )
virtual

Get annotation name string.

The annotation name, a text string uniquely identifying it among all the annotations on its page.

Returns
A String object that receives the name string. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no name property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual float Foxit::PDF::Annotations::FreeText::GetOpacity ( )
virtual

Get opacity value.

Returns
Opacity value. Valid Range is from 0.0 to 1.0.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no opacity property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual Popup ^ Foxit::PDF::Annotations::FreeText::GetPopup ( )
virtual

Get related pop-up annotation.

All the markup annotations can have a pop-up annotation. But for free text and sound annotations, they do not need a pop-up annotation.

Returns
An Annotations::Popup object that receives the related pop-up annotation. If the property cannot be found or there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means current annotation doesn't have a pop-up annotation.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual RectF ^ Foxit::PDF::Annotations::FreeText::GetRect ( )
virtual

Get rectangle value.

Returns
A Foxit::RectF object that receives the rectangle value. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no rectangle property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual Note ^ Foxit::PDF::Annotations::FreeText::GetReply ( Int32  index)
virtual

Get a reply annotation by index.

Markup annotations may have several reply annotations which are represented by note annotations. Usually, viewer applications should not display reply annotations individually but together in the form of threaded comments.

Parameters
[in]indexIndex of the replay annotation to be got. Range: 0 to (replyCount-1). replyCount is returned by function IMarkup::CountReplies.
Returns
An Annotations::Note object that receives the specified reply annotation. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means parameter index is out of range.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual Note ^ Foxit::PDF::Annotations::FreeText::GetState ( Int32  stateModel,
Int32  index 
)
virtual

Get a state annoation with specific state model, related to current markup annotation.

Markup annotations may have an author-specific state associated with them. The state is not specified in the annotation itself but in a separate text annotation that refers to the original annotation. When a note annotation represents a state annotation, this note annotation will not be displayed individually.

Parameters
[in]stateModelThe state model. It should be one of following values:
[in]indexThe index of a state annotation to be got. Range: 0 to (stateCount-1). stateCount is returned by function IMarkup::CountStates.
Returns
An Annotations::Note object that receives the specified state annotation. If there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter stateModel is invalid.
ErrorCode::NotFound means parameter index is out of range.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual String ^ Foxit::PDF::Annotations::FreeText::GetSubject ( )
virtual

Get subject string.

Returns
A String object that receives the subject string.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no subject property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual String ^ Foxit::PDF::Annotations::FreeText::GetTitle ( )
virtual

Get title string.

Returns
A String object that receives the title string.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means no title property can be found.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual AnnotType Foxit::PDF::Annotations::FreeText::GetType ( )
virtual

Get the type of current annotation.

Returns
Annotation type. Please refer to enumeration Annotations::AnnotType and this would be one of its values.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual Boolean Foxit::PDF::Annotations::FreeText::IsGrouped ( )
virtual

Check whether current markup annotation is in a group or not.

Markup annotations can be grouped. The group consists of a primary annotation and one or more subordinate annotations. Some entries in the primary annotation are treated as group attributes that should apply to the group as a whole; the corresponding entries in the subordinate annotations should be ignored. These entries are contents, last modification time, fill color/border color, title, pop-up annotation, creation time, subject, and open status.
Operations that manipulate any annotation in a group, such as movement, cut, and copy, should be treated by viewer applications as acting on the entire group.

Returns
A boolean value: true means current markup annotation is in a group, while false means current markup annotation does not belong to any group.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual Boolean Foxit::PDF::Annotations::FreeText::IsMarkup ( )
virtual

Check if current annotation is a markup annotation.

Returns
A boolean value: true means current annotation is a markup annotation, while false means current annotation is not a markup annotation.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual Boolean Foxit::PDF::Annotations::FreeText::Move ( RectF rect)
virtual

Move current annotation to a new position specified by a rectangle.

To move an annotation is to reset its rectangle.

Parameters
[in]rectA Foxit::RectF object that specifies the new position. The rect should be "normalized" for PDF page coordination: left is always smaller than right, and bottom is always smaller than top.
Returns
A boolean value: true means success, while false means failure.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter rect is invalid.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual Boolean Foxit::PDF::Annotations::FreeText::RemoveAllReplies ( )
virtual

Remove all the reply annotations.

Markup annotations may have several reply annotations which are represented by note annotations. Usually, viewer applications should not display reply annotations individually but together in the form of threaded comments.

Returns
A boolean value: true means success, while false means failure.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual Boolean Foxit::PDF::Annotations::FreeText::RemoveAllStates ( )
virtual

Remove all the state annotations.

Markup annotations may have an author-specific state associated with them. The state is not specified in the annotation itself but in a separate text annotation that refers to the original annotation. When a note annotation represents a state annotation, this note annotation will not be displayed individually.

Returns
A boolean value: true means success, while false means failure.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual Boolean Foxit::PDF::Annotations::FreeText::RemoveReply ( Int32  index)
virtual

Remove a reply annotation by index.

Markup annotations may have several reply annotations which are represented by note annotations. Usually, viewer applications should not display reply annotations individually but together in the form of threaded comments.

Parameters
[in]indexIndex of the replay annotation to be got. Range: 0 to (replyCount-1). replyCount is returned by function IMarkup::CountReplies.
Returns
A boolean value: true means success, while false means failure.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means parameter index is out of range.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

Boolean Foxit::PDF::Annotations::FreeText::ResetApppearanceStream ( )

Reset(regenerate) the appearance stream.

Returns
A boolean value: true means success, while false means error.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::UnknownState means some necessary property of current annotation does not be set correctly.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
void Foxit::PDF::Annotations::FreeText::SetAlignment ( Int32  alignment)

Set alignment.

Parameters
[in]alignmentAn integer value that specifies the new alignment. It should be one of following values:
  • 0: Left-justified
  • 1: Centered
  • 2: Right-justified
Returns
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter alignment is invalid.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
virtual void Foxit::PDF::Annotations::FreeText::SetBorderInfo ( BorderInfo border)
virtual

Set border information.

After calling this function to change BorderInfo::Color of a freetext annotation successfully, if you want to get the new border color correctly, please ensure function FreeText::ResetApppearanceStream has been called successfully first.

Parameters
[in]borderAn Annotations::BorderInfo object that specifies the new border information to be set. Please refer to comment of Annotations::BorderInfo for more details.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter border is nullptr or some properties of border is invalid.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

void Foxit::PDF::Annotations::FreeText::SetCalloutLinePoints ( PointF point1,
PointF point2,
PointF point3 
)

Set points of callout line.

Only when the intent name of a free text annotation is "FreeTextCallout", this free text annotation can have callout line points property. Callout line points property can have 2 or 3 points:

  • 2 points represent the starting and ending coordinates of the callout line.
  • 3 points represent the starting, knee point, and ending coordinates of the callout line.
Parameters
[in]point1A Foxit::PointF obejct that specifies the start point of the callout line. It should be valid and cannot be nullptr.
[in]point2A Foxit::PointF obejct that specifies the second point of the callout line.
  • If parameter point3 is nullptr, the callout line only consists of 2 points, and point2 represents the end point.
  • If parameter point3 is not nullptr, the callout line consists of 3 points, and point2 represents the knee point.
It should be valid and cannot be nullptr.
[in]point3A Foxit::PointF obejct that specifies the third point of the callout line. It can be nullptr:
  • If this is nullptr, the callout line only consists of 2 points.
  • If this is valid, the callout line consists of 3 points.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter point1 or point2 is nullptr.
ErrorCode::Unsupported means intent name of current freetext annotation is not "FreeTextCallout".
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
virtual void Foxit::PDF::Annotations::FreeText::SetContents ( String^  content)
virtual

Set the contents data.

Contents data is the text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form. In either case, this text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes.
Please ensure that a free text annotation has already been set the default appearance property for keeping its contents data useful.

Parameters
[in]contentA String object that specifies the new contents data to be set. It can be nullptr or empty.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual void Foxit::PDF::Annotations::FreeText::SetCreationTime ( DateTime creationTime)
virtual

Set the creation time.

Parameters
[in]creationTimeA Foxit::DateTime object that specifies the new creation time data to be set. It should be valid and should not be nullptr.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter creationTime is nullptr or invalid.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

void Foxit::PDF::Annotations::FreeText::SetDefaultAppearance ( DefaultAppearance defaultAP)

Set default appearance data.

Default appearance data can be used in formatting text. This property is necessary for a free text annotation.

Parameters
[in]defaultAPA PDF::DefaultAppearance object that specifies the new default appearance data to be set.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter defaultAP is nullptr or some members of defaultAP is invalid.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
virtual void Foxit::PDF::Annotations::FreeText::SetFlags ( UInt32  flags)
virtual

Set annotation flags.

Parameters
[in]flagsValue of flags. Please refer to enumeration Annotations::Flags and this can be one or combination of its values.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual void Foxit::PDF::Annotations::FreeText::SetIntent ( String^  intent)
virtual

Set intent name.

Intent name is a name describing the intent of the markup annotation. Intents allow viewer applications to distinguish between different uses and behaviors of a single markup annotation type. If this property string is not present or its value is the same as the annotation type, the annotation has no explicit intent and should behave in a generic manner in a viewer application.

Parameters
[in]intentA String object that specifies the new intent name to be set. It should not be either nullptr or empty.
Free text annotation has predefined intent names:
  • "FreeTextCallout"
  • "FreeTextTypewriter"
Returns
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

void Foxit::PDF::Annotations::FreeText::SetLineEndingStyles ( String^  startingStyle,
String^  endingStyle 
)

Set line ending styles of callout line.

Only when the intent name of a free text annotation is "FreeTextCallout", this free text annotation can have line ending styles property.
Valid line ending styles are: "None", "Square", "Circle", "Diamond", "OpenArrow", "ClosedArrow", "Butt", "ROpenArrow", "RClosedArrow", "Slash".

Parameters
[in]startingStyleA String object that specifies the new line ending style for start point of callout line. Please refer to "Details" part of this method about the valid strings for line ending style.
[in]endingStyleA String object that specifies the new line ending style for end point of callout line. Please refer to "Details" part of this method about the valid strings for line ending style.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter startingStyle or endingStyle is invalid.
ErrorCode::Unsupported means intent name of current freetext annotation is not "FreeTextCallout".
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
virtual void Foxit::PDF::Annotations::FreeText::SetModifiedTime ( DateTime modifiedTime)
virtual

Set the last modification time.

Parameters
[in]modifiedTimeA Foxit::DateTime object that specifies the new last modification time data to be set. It should be valid and should not be nullptr.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter modifiedTime is nullptr or invalid.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual void Foxit::PDF::Annotations::FreeText::SetName ( String^  name)
virtual

Get annotation name string.

The annotation name, a text string uniquely identifying it among all the annotations on its page.

Parameters
[in]nameA String object that specifies the new name string. This can be nullptr or empty.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IAnnot.

virtual void Foxit::PDF::Annotations::FreeText::SetOpacity ( float  opacity)
virtual

Set opacity value.

Parameters
[in]opacityNew opacity value to be set. Valid range is from 0.0 to 1.0.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Param means parameter opacity is invalid.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual void Foxit::PDF::Annotations::FreeText::SetSubject ( String^  subject)
virtual

Set subject string.

Parameters
[in]subjectA String object that specifies the new title string to be set. It can be nullptr or empty.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual void Foxit::PDF::Annotations::FreeText::SetTitle ( String^  title)
virtual

Set title string.

Parameters
[in]titleA String object that specifies the new title string to be set. It can be nullptr or empty.
Returns
None.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

virtual Boolean Foxit::PDF::Annotations::FreeText::Ungroup ( )
virtual

Ungroup current markup annotation from the group it belongs to.

Markup annotations can be grouped. The group consists of a primary annotation and one or more subordinate annotations. Some entries in the primary annotation are treated as group attributes that should apply to the group as a whole; the corresponding entries in the subordinate annotations should be ignored. These entries are contents, last modification time, fill color/border color, title, pop-up annotation, creation time, subject, and open status.
Operations that manipulate any annotation in a group, such as movement, cut, and copy, should be treated by viewer applications as acting on the entire group.

Returns
A boolean value: true means success, while false means failure.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Implements Foxit::PDF::Annotations::IMarkup.

Foxit Corporation