Public Member Functions | Static Public Attributes | Protected Member Functions

de.softpro.doc.SignDocAnnotation Class Reference

An annotation. More...

List of all members.

Public Member Functions

synchronized int getType () throws SignDocException
 Get the type of the annotation.
synchronized String getName () throws SignDocException
 Get the name of the annotation.
synchronized int getPage () throws SignDocException
 Get the page number of the annotation.
synchronized Rect getBoundingBox () throws SignDocException
 Get the bounding box of the annotation.
synchronized int setName (String aName) throws SignDocException
 Set the name of the annotation.
synchronized int setLineEnding (int aStart, int aEnd) throws SignDocException
 Set line ending styles.
synchronized int setColor (SignDocColor aColor) throws SignDocException
 Set the color of the annotation.
synchronized int setBackgroundColor (SignDocColor aColor) throws SignDocException
 Set the background color of the annotation.
synchronized int setBorderColor (SignDocColor aColor) throws SignDocException
 Set the border color of the annotation.
synchronized int setOpacity (double aOpacity) throws SignDocException
 Set the opacity of the annotation.
synchronized int setLineWidthInPoints (double aWidth) throws SignDocException
 Set line width in points.
synchronized int setBorderLineWidthInPoints (double aWidth) throws SignDocException
 Set border line width in points.
synchronized int newStroke () throws SignDocException
 Start a new stroke in a scribble annotation.
synchronized int addPoint (Point aPoint) throws SignDocException
 Add a point to the current stroke of a scribble annotation.
synchronized int addPoint (double aX, double aY) throws SignDocException
 Add a point to the current stroke of a scribble annotation.
synchronized int setPlainText (String aText, String aFont, double aFontSize, int aHAlignment) throws SignDocException
 Set the text of a text annotation.
synchronized String getPlainText () throws SignDocException
 Get the plain text of a text annotation.
synchronized String getFont () throws SignDocException
 Get the font of a text annotation.
synchronized Double getFontSize () throws SignDocException
 Get the font size of a text annotation.
synchronized int setFlags (int aFlags) throws SignDocException
 Set flags.

Static Public Attributes

static final int t_unknown = 0
 Annotation type: Unknown annotation type.
static final int t_line = 1
 Annotation type: Line annotation.
static final int t_scribble = 2
 Annotation type: Scribble annotation (freehand scribble).
static final int t_freetext = 3
 Annotation type: Text annotation.
static final int le_unknown = 0
 Line ending style: Unknown line ending style.
static final int le_none = 1
 Line ending style: No line ending.
static final int le_arrow = 2
 Line ending style: Two short lines forming an arrowhead.
static final int ha_left = 0
 Horizontal alignment: Align left.
static final int ha_center = 1
 Horizontal alignment: Center.
static final int ha_right = 2
 Horizontal alignment: Align right.
static final int rc_ok = 0
 Return code: Parameter set successfully.
static final int rc_not_supported = 1
 Return code: Setting the parameter is not supported.
static final int rc_invalid_value = 2
 Return code: The value for the parameter is invalid.
static final int f_auto_alignment = 0x200
 Flag for setFlags(): Align left if the text begins with an LTR run, align right if the text begins with an RTL run.
static final int f_ltr = 0x1000
 Flag for setFlags(): Paragraph direction: LTR.
static final int f_rtl = 0x2000
 Flag for setFlags(): Paragraph direction: RTL.
static final int f_default_ltr = 0x4000
 Flag for setFlags(): Choose direction automatically, default to LTR.
static final int f_default_rtl = 0x8000
 Flag for setFlags(): Choose direction automatically, default to RTL.

Protected Member Functions

void finalize () throws Throwable
 Finalize this object.

Detailed Description

An annotation.


Member Function Documentation

synchronized int de.softpro.doc.SignDocAnnotation.addPoint ( Point  aPoint ) throws SignDocException

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

This function can be used for annotations of type t_scribble. Each stroke must contain at least two points.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters:
[in]aPointThe point to be added.
Returns:
rc_ok iff successful.
See also:
newStroke()
synchronized int de.softpro.doc.SignDocAnnotation.addPoint ( double  aX,
double  aY 
) throws SignDocException

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

This function can be used for annotations of type t_scribble. Each stroke must contain at least two points.

This function uses document (page) coordinates, see Coordinate Systems.

Parameters:
[in]aXThe X coordinate of the point.
[in]aYThe Y coordinate of the point.
Returns:
rc_ok iff successful.
See also:
newStroke()
void de.softpro.doc.SignDocAnnotation.finalize (  ) throws Throwable [protected]

Finalize this object.

Do not call this method unless you know what you are doing.

synchronized Rect de.softpro.doc.SignDocAnnotation.getBoundingBox (  ) throws SignDocException

Get the bounding box of the annotation.

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

Returns:
The bounding box (using document coordinates, see Coordinate Systems) or null if not available.
synchronized String de.softpro.doc.SignDocAnnotation.getFont (  ) throws SignDocException

Get the font of a text annotation.

Returns:
The font name of the annotation. The return value is null if the font name is not available.
See also:
getFontSize(), getPlainText(), setPlainText()
synchronized Double de.softpro.doc.SignDocAnnotation.getFontSize (  ) throws SignDocException

Get the font size of a text annotation.

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()
synchronized String de.softpro.doc.SignDocAnnotation.getName (  ) throws SignDocException

Get the name of the annotation.

Returns:
The name of the annotation or an empty string if the name is not available. If flag SignDocDocument.f_keep_escape_sequences is set, the string may contain escape sequences for selecting natural languages.
synchronized int de.softpro.doc.SignDocAnnotation.getPage (  ) throws SignDocException

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.
synchronized String de.softpro.doc.SignDocAnnotation.getPlainText (  ) throws SignDocException

Get the plain text of a text annotation.

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 SignDocDocument.f_keep_escape_sequences is set, the string may contain escape sequences for selecting natural languages.
See also:
getFont(), setPlainText()
synchronized int de.softpro.doc.SignDocAnnotation.getType (  ) throws SignDocException

Get the type of the annotation.

See also:
t_line, t_scribble
synchronized int de.softpro.doc.SignDocAnnotation.newStroke (  ) throws SignDocException

Start a new stroke in a scribble annotation.

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

Returns:
rc_ok iff successful.
See also:
addPoint()
synchronized int de.softpro.doc.SignDocAnnotation.setBackgroundColor ( SignDocColor  aColor ) throws SignDocException

Set the background color of the annotation.

This function can be used for annotations of type t_freetext.

The default background color is white.

Parameters:
[in]aColorThe background color of the annotation.
Returns:
rc_ok iff successful.
synchronized int de.softpro.doc.SignDocAnnotation.setBorderColor ( SignDocColor  aColor ) throws SignDocException

Set the border color of the annotation.

This function can be used for annotations of type t_freetext. The default border color is black.

Parameters:
[in]aColorThe border color of the annotation.
Returns:
rc_ok iff successful.
See also:
setBorderLineWidthInPoints()
synchronized int de.softpro.doc.SignDocAnnotation.setBorderLineWidthInPoints ( double  aWidth ) throws SignDocException

Set border line width in points.

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

Parameters:
[in]aWidthThe border line width in points (1/72 inch). If this value is negative, no border lines will be drawn.
Returns:
rc_ok iff successful.
See also:
setBorderColor()
synchronized int de.softpro.doc.SignDocAnnotation.setColor ( SignDocColor  aColor ) throws SignDocException

Set the color of the annotation.

This function can be used for annotations of types t_line and t_scribble. The default color is black.

Parameters:
[in]aColorThe color of the annotation.
Returns:
rc_ok iff successful.
synchronized int de.softpro.doc.SignDocAnnotation.setFlags ( int  aFlags ) throws SignDocException

Set flags.

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

Parameters:
[in]aFlagsSee f_auto_alignment, f_ltr, f_rtl, f_default_ltr, and f_default_rtl.
See also:
setPlainText()
synchronized int de.softpro.doc.SignDocAnnotation.setLineEnding ( int  aStart,
int  aEnd 
) throws SignDocException

Set line ending styles.

This function can be used for annotations of type t_line. The default line ending style is le_none.

Parameters:
[in]aStartLine ending style for start point (le_none or le_arrow).
[in]aEndLine ending style for end point (le_none or le_arrow).
Returns:
rc_ok iff successful.
synchronized int de.softpro.doc.SignDocAnnotation.setLineWidthInPoints ( double  aWidth ) throws SignDocException

Set line width in points.

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

Parameters:
[in]aWidthThe line width in points (1/72 inch).
Returns:
rc_ok iff successful.
synchronized int de.softpro.doc.SignDocAnnotation.setName ( String  aName ) throws SignDocException

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:
[in]aNameThe name of the annotation.
Returns:
rc_ok iff successful.
synchronized int de.softpro.doc.SignDocAnnotation.setOpacity ( double  aOpacity ) throws SignDocException

Set the opacity of the annotation.

This function can be used for annotations of types t_line and t_scribble.

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

Parameters:
[in]aOpacityThe opacity, 0.0 (transparent) through 1.0 (opaque).
Returns:
rc_ok iff successful.
synchronized int de.softpro.doc.SignDocAnnotation.setPlainText ( String  aText,
String  aFont,
double  aFontSize,
int  aHAlignment 
) throws SignDocException

Set the text of a text annotation.

This function can be used for annotations of type t_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\u00A0\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:
[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 (ha_left, ha_center, ha_right).
See also:
getFont(), getFontSize(), getPlainText(), setFlags(), SignDocDocumentLoader.loadFontConfigFile(), SignDocDocumentLoader.loadFontConfigEnvironment()

Member Data Documentation

Flag for setFlags(): Align left if the text begins with an LTR run, align right if the text begins with an RTL run.

This flag overrides for creating the appearance stream ha_left and ha_right passed to aHAlignment of setPlainText(). This flag is ignored for ha_center.

See also:
f_default_ltr, f_default_rtl, f_ltr, f_rtl

Flag for setFlags(): Choose direction automatically, default to LTR.

The base direction of each paragraph (BiDi paragraph level) will depend on the first strong directional character in the paragraph.

The paragraph level will be 0 (LTR) for paragraphs having no strong directional character.

If none of f_ltr, f_rtl, f_default_ltr, and f_default_rtl is set, f_ltr will be used.

At most one of f_ltr, f_rtl, f_default_ltr, and f_default_rtl can be set.

Usage of f_default_ltr is not recommended as the visual representation of the text of the annotation may not match the value of the annotation (as interpreted by software which does not know that the paragraph direction is supposed to be default-LTR). Use f_default_ltr only as last resort if you cannot modify the text received from a default-LTR input field appropriately for paragraph direction LTR used in PDF annotations.

See also:
f_auto_alignment

Flag for setFlags(): Choose direction automatically, default to RTL.

The base direction of each paragraph (BiDi paragraph level) will depend on the first strong directional character in the paragraph.

The paragraph level will be 1 (RTL) for paragraphs having no strong directional character.

If none of f_ltr, f_rtl, f_default_ltr, and f_default_rtl is set, f_ltr will be used.

At most one of f_ltr, f_rtl, f_default_ltr, and f_default_rtl can be set.

Usage of f_default_rtl is not recommended as the visual representation of the text of the annotation may not match the value of the annotation (as interpreted by software which does not know that the paragraph direction is supposed to be default-RTL). Use f_default_rtl only as last resort if you cannot modify the text received from a default-RTL input field appropriately for paragraph direction LTR used in PDF annotations.

See also:
f_auto_alignment
final int de.softpro.doc.SignDocAnnotation.f_ltr = 0x1000 [static]

Flag for setFlags(): Paragraph direction: LTR.

If none of f_ltr, f_rtl, f_default_ltr, and f_default_rtl is set, f_ltr will be used.

At most one of f_ltr, f_rtl, f_default_ltr, and f_default_rtl can be set.

See also:
f_auto_alignment
final int de.softpro.doc.SignDocAnnotation.f_rtl = 0x2000 [static]

Flag for setFlags(): Paragraph direction: RTL.

If none of f_ltr, f_rtl, f_default_ltr, and f_default_rtl is set, f_ltr will be used.

At most one of f_ltr, f_rtl, f_default_ltr, and f_default_rtl can be set.

Usage of f_rtl is not recommended as the visual representation of the text of the annotation may not match the plain text of the annotation (as interpreted by software which does not know that the paragraph direction is supposed to be RTL). Use f_rtl only as last resort if you cannot modify the text received from an RTL input field appropriately for paragraph direction LTR used in PDF annotations.

See also:
f_auto_alignment

Horizontal alignment: Center.

Horizontal alignment: Align left.

Horizontal alignment: Align right.

Line ending style: Two short lines forming an arrowhead.

Line ending style: No line ending.

Line ending style: Unknown line ending style.

Return code: The value for the parameter is invalid.

Return code: Setting the parameter is not supported.

Return code: Parameter set successfully.

Annotation type: Text annotation.

Annotation type: Line annotation.

Annotation type: Scribble annotation (freehand scribble).

Annotation type: Unknown annotation type.


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