SignDoc SDK (.NET without exceptions)  5.0.0
SignDocAnnotation Class Reference

An annotation. More...

Public Member Functions

 ~SignDocAnnotation ()
 Destructor. More...
 
 !SignDocAnnotation ()
 Finalizer. More...
 
AnnotationType getType ()
 Get the type of the annotation. More...
 
string getName ()
 Get the name of the annotation. More...
 
int getPage ()
 Get the page number of the annotation. More...
 
Rect getBoundingBox ()
 Get the bounding box of the annotation. More...
 
void setName (out ReturnCode aReturnCode, string aName)
 Set the name of the annotation. More...
 
void setLineEnding (out ReturnCode aReturnCode, LineEnding aStart, LineEnding aEnd)
 Set line ending styles. More...
 
void setColor (out ReturnCode aReturnCode, SignDocColor aColor)
 Set the foreground color of the annotation. More...
 
void setBackgroundColor (out ReturnCode aReturnCode, SignDocColor aColor)
 Set the background color of the annotation. More...
 
void setBorderColor (out ReturnCode aReturnCode, SignDocColor aColor)
 Set the border color of the annotation. More...
 
void setOpacity (out ReturnCode aReturnCode, double aOpacity)
 Set the opacity of the annotation. More...
 
void setLineWidthInPoints (out ReturnCode aReturnCode, double aWidth)
 Set line width in points. More...
 
void setBorderLineWidthInPoints (out ReturnCode aReturnCode, double aWidth)
 Set border line width in points. More...
 
void newStroke (out ReturnCode aReturnCode)
 Start a new stroke in a scribble annotation. More...
 
void addPoint (out ReturnCode aReturnCode, Point aPoint)
 Add a point to the current stroke of a scribble annotation. More...
 
void addPoint (out ReturnCode aReturnCode, double aX, double aY)
 Add a point to the current stroke of a scribble annotation. More...
 
void setPlainText (out ReturnCode aReturnCode, string aText, string aFont, double aFontSize, AnnotationHAlignment aHAlignment)
 Set the text of a text annotation. More...
 
string getPlainText (out ReturnCode aReturnCode)
 Get the plain text of a text annotation. More...
 
string getFont (out ReturnCode aReturnCode)
 Get the font of a text annotation. More...
 
double? getFontSize (out ReturnCode aReturnCode)
 Get the font size of a text annotation. More...
 
void setFlags (out ReturnCode aReturnCode, AnnotationFlags aFlags)
 Set flags. More...
 
string getErrorMessage ()
 Get an error message for the last function call. More...
 

Detailed Description

Constructor & Destructor Documentation

Destructor.

Finalizer.

Member Function Documentation

void addPoint ( out ReturnCode  aReturnCode,
Point  aPoint 
)

Add a point to the current stroke of a scribble annotation.

This function can be used for annotations of type AnnotationType.Scribble. Each stroke must contain at least two points. This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aPointThe point to be added.
See also
newStroke()
void addPoint ( out ReturnCode  aReturnCode,
double  aX,
double  aY 
)

Add a point to the current stroke of a scribble annotation.

This function can be used for annotations of type AnnotationType.Scribble. Each stroke must contain at least two points. This function uses document (page) coordinates, see Coordinate Systems.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aXThe X coordinate of the point.
[in]aYThe Y coordinate of the point.
See also
newStroke()
Rect getBoundingBox ( )

Get the bounding box of the annotation.

The bounding box is available for objects returned by SignDocDocument.getAnnotation() only.

Returns
The bounding box (using document coordinates, see Coordinate Systems) or null if not available.
string getErrorMessage ( )

Get an error message for the last function call.

Returns
A string describing the reason for the failure of the last function call. The string is empty if the last call succeeded.
string getFont ( out ReturnCode  aReturnCode)

Get the font of a text annotation.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The font name of the annotation. The return value is null if the font name is not available.
See also
getFontSize(), getPlainText(), setPlainText()
double? getFontSize ( out ReturnCode  aReturnCode)

Get the font size of a text annotation.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The font size (in user space units) of the annotation. The return value is null if the font size is not available.
See also
getFont(), getPlainText(), setPlainText()
string getName ( )

Get the name of the annotation.

Returns
The name of the annotation or an empty string if the name is not available. If flag DocumentFlags.KeepEscapeSequences is set, the string may contain escape sequences for selecting natural languages.
int getPage ( )

Get the page number of the annotation.

The page number is available for objects returned by SignDocDocument.getAnnotation() only.

Returns
the 1-based page number of the annotation or 0 if the page number is not available.
string getPlainText ( out ReturnCode  aReturnCode)

Get the plain text of a text annotation.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
Returns
The plain text of the annotation. The start of a new paragraph (except for the first one is represented by CR and/or LF characters. The return value is null if the plain text is not available. If flag DocumentFlags.KeepEscapeSequences is set, the string may contain escape sequences for selecting natural languages.
See also
getFont(), setPlainText()
AnnotationType getType ( )

Get the type of the annotation.

Returns
The type of the annotation.
void newStroke ( out ReturnCode  aReturnCode)

Start a new stroke in a scribble annotation.

This function can be used for annotations of type AnnotationType.Scribble. Each stroke must contain at least two points. This function need not be called for the first stroke of a scribble annotation.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
See also
addPoint()
void setBackgroundColor ( out ReturnCode  aReturnCode,
SignDocColor  aColor 
)

Set the background color of the annotation.

This function can be used for annotations of type AnnotationType.FreeText.

The default background color is white.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aColorThe background color of the annotation.
void setBorderColor ( out ReturnCode  aReturnCode,
SignDocColor  aColor 
)

Set the border color of the annotation.

This function can be used for annotations of type AnnotationType.FreeText.

The default border color is black.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aColorThe border color of the annotation.
See also
setBorderLineWidthInPoints()
void setBorderLineWidthInPoints ( out ReturnCode  aReturnCode,
double  aWidth 
)

Set border line width in points.

This function can be used for annotations of type AnnotationType.FreeText. The default border line width for PDF documents is 1 point.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aWidthThe border line width in points (1/72 inch). If this value is negative, no border lines will be drawn.
See also
setBorderColor()
void setColor ( out ReturnCode  aReturnCode,
SignDocColor  aColor 
)

Set the foreground color of the annotation.

This function can be used for annotations of types AnnotationType.Line, AnnotationType.Scribble, and AnnotationType.FreeText.

The default foreground color is black.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aColorThe foreground color of the annotation.
void setFlags ( out ReturnCode  aReturnCode,
AnnotationFlags  aFlags 
)

Set flags.

This function can be used for annotations of type AnnotationType.FreeText. Initially, no flag is set.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aFlagsSee AnnotationFlags.
See also
setPlainText()
void setLineEnding ( out ReturnCode  aReturnCode,
LineEnding  aStart,
LineEnding  aEnd 
)

Set line ending styles.

This function can be used for annotations of type AnnotationType.Line. The default line ending style is LineEnding.None.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aStartLine ending style for start point.
[in]aEndLine ending style for end point.
void setLineWidthInPoints ( out ReturnCode  aReturnCode,
double  aWidth 
)

Set line width in points.

This function can be used for annotations of types AnnotationType.Line and AnnotationType.Scribble. The default line width for PDF documents is 1 point.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aWidthThe line width in points (1/72 inch).
void setName ( out ReturnCode  aReturnCode,
string  aName 
)

Set the name of the annotation.

In PDF documents, an annotation can have a name. The names of annotations must be unique within a page. By default, annotations are unnamed.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aNameThe name of the annotation.
void setOpacity ( out ReturnCode  aReturnCode,
double  aOpacity 
)

Set the opacity of the annotation.

This function can be used for annotations of types AnnotationType.Line, AnnotationType.Scribble, and AnnotationType.FreeText.

The default opacity is 1.0. Documents conforming to PDF/A-1 must use an opacity of 1.0.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aOpacityThe opacity, 0.0 (transparent) through 1.0 (opaque).
void setPlainText ( out ReturnCode  aReturnCode,
string  aText,
string  aFont,
double  aFontSize,
AnnotationHAlignment  aHAlignment 
)

Set the text of a text annotation.

This function can be used for annotations of type AnnotationType.FreeText.

Any sequence of CR and LF characters in the text starts a new paragraph (ie, text following such a sequence will be placed at the beginning of the next output line). In consequence, empty lines in the input do not produce empty lines in the output. To get an empty line in the output, you have to add a paragraph containing a non-breaking space (0xa0) only:

"Line before empty line\n\xa0\nLine after empty line"

Complex scripts are supported, see Complex Scripts. By default, this function uses paragraph direction LTR. Use setFlags() if you need to set a different paragraph direction.

Parameters
[out]aReturnCodeThe return code, ReturnCode.OK iff successful.
[in]aTextThe text. Allowed control characters are CR and LF. Any sequence of CR and LF characters starts a new paragraph. Escape sequences must not be used.
[in]aFontThe name of the font to be used. The font substitition rules of the loaded font configuration files will be used. The resulting font must be a standard PDF font or a font for which a file is specified in the font configuration files.
[in]aFontSizeThe font size in user space units.
[in]aHAlignmentHorizontal alignment of the text.
See also
getFont(), getPlainText(), setFlags(), SignDocDocumentLoader.loadFontConfigBlob(), SignDocDocumentLoader.loadFontConfigEnvironment(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigStream()

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