Text Class Documentation

classText : Element

Namespace:com::datalogics::PDFL

Inherits from:
Element

Detailed Description

A container that represents a series of text elements and characters. A Text object is container that represents both a series of TextRun elements and a series of text characters. Operations can be performed on individual TextRuns within a Text or on individual characters within a Text by specifying the index of the individual TextRun or character. All indices start at 0.

Referenced by

Constructor & Destructor Documentation

Text

Text()

Member Function Documentation

DisposeChildren

voidDisposeChildren()

Returns:

void

[static initializer]

static void[static initializer]()

addGlyphs

voidaddGlyphs(java.util.List< java.lang.Character >glyphIDs, java.util.List< java.lang.Character >uniText, Fontfont, GraphicStategState, TextStatestate, Matrixmatrix, java.util.EnumSet< TextFlags >flags)

Parameters

glyphIDs: java.util.List< java.lang.Character >

Glyphs IDs in the specified font for adding to the page's content

uniText: java.util.List< java.lang.Character >

Unicode codes for the specified glyph IDs

font: Font

Font for wich GlyphIDs were specified

gState: GraphicState

The GraphicsState for Text element

state: TextState

TextState flags

matrix: Matrix

matrix for the Text element

flags: java.util.EnumSet< TextFlags >

TextFlags that specifies what kind of text to add

Returns:

void

Adds Unicode text to a Text object

addGlyphs

voidaddGlyphs(java.util.List< java.lang.Character >glyphIDs, java.util.List< java.lang.Character >uniText, Fontfont, GraphicStategState, TextStatestate, Matrixmatrix, java.util.EnumSet< TextFlags >flags, intindex)

Parameters

glyphIDs: java.util.List< java.lang.Character >

Glyphs IDs in the specified font to add to the page's content

uniText: java.util.List< java.lang.Character >

Unicode codes for the specified glyph IDs

font: Font

Font for wich GlyphIDs were specified

gState: GraphicState

The GraphicsState for Text element

state: TextState

TextState flags

matrix: Matrix

matrix for the Text element

flags: java.util.EnumSet< TextFlags >

TextFlags that specifies what kind of text to add

index: int

The index after which to add the character or text run.

Returns:

void

Adds Unicode text to a Text object

addRun

voidaddRun(TextRunrun)

Parameters

run: TextRun

Returns:

void

Adds a TextRun to the end of this text element.

addRun

voidaddRun(TextRunrun, intindex)

Parameters

run: TextRun

TextRun to be added

index: int

Index, where TextRun should be placed

Returns:

void

Adds a TextRun at the specified index.

changeMatrixForTextRun

voidchangeMatrixForTextRun(MatrixnewMatrix, inttextRunIndex)

Parameters

newMatrix: Matrix

The new transformation matrix to use for the TextRun.

textRunIndex: int

The index of a TextRun, relative to the Text object (the first TextRun in the Text object is at index 0).

Returns:

void

Changes the transformation matrix from user space to the current text space for the specified TextRun. Unlike ChangeTextMatrixForTextRun(), this function does not change fontSize, hScale, and textRise in the textState of PDEText. The H and V values of the matrix indicate the origin of the first character.

changeTextMatrixForTextRun

voidchangeTextMatrixForTextRun(MatrixnewMatrix, inttextRunIndex)

Parameters

newMatrix: Matrix

The new transformation matrix to use for the TextRun.

textRunIndex: int

The index of a TextRun, relative to the Text object (the first TextRun in the Text object is at index 0).

Returns:

void

Changes the transformation matrix from user space to the current text space for the specified TextRun. The H and V values of the matrix indicate the origin of the first character.

clone

Textclone()

Returns:

The copied text.

Makes a copy of the text.

Make a copy of an text to obtain a new text that has a distinct set of attributes.

clone

Textclone(java.util.EnumSet< ElementCloneFlags >cloneFlags)

Parameters

cloneFlags: java.util.EnumSet< ElementCloneFlags >

Flags that modify the cloning operation.

Returns:

The copied text.

Makes a copy of the text.

Make a copy of an text to obtain a new text that has a distinct set of attributes.

colorConvert

TextcolorConvert(Documentdocument, ColorProfileprof, RenderIntentintent, booleanembed)

Parameters

document: Document

The document the element belongs to.

prof: ColorProfile

The ICC ColorProfile to be applied.

intent: RenderIntent

The ICC Rendering Intent for the ColorProfile

embed: boolean

If true, embed the color space and make the object calibrated. If it is false and the target profile is CMYK, RGB, or Gray, the colors space of the resulting object, after conversion, will be DeviceCMYK, DeviceRGB, or DeviceGray, respectively.

Returns:

A new Text object with the applied ICC ColorProfile.

Applies the specified ICC ColorProfile to the Text object

delete

synchronized voiddelete(Booleandisposing)

Parameters

disposing: Boolean

Returns:

synchronized void

delete

synchronized voiddelete()

Returns:

synchronized void

finalize

voidfinalize()

Returns:

void

findTextRunIndexForCharacter

intfindTextRunIndexForCharacter(intcharacterIndex)

Parameters

characterIndex: int

The index of a character, relative to the Text object (the first character in the Text object is at index 0).

Returns:

The index of the TextRun that contains the character specified by characterIndex.

Finds the index of the TextRun that contains the nth character in a Text object.

getAdvanceForCharacter

PointgetAdvanceForCharacter(intcharacterIndex)

Parameters

characterIndex: int

The index of a character, relative to the Text object (the first character in the Text object is at index 0).

Returns:

A value specifying both the horizontal and vertical components of the advance width of a character in user space.

Gets the advance width of a character, in user space. The advance width is the amount by which the current point advances when the character is drawn.

Advance width may be horizontal or vertical, depending on the writing style. Thus, the return value has both a horizontal and a vertical component.

getAdvanceForTextRun

PointgetAdvanceForTextRun(inttextRunIndex)

Parameters

textRunIndex: int

The index of a TextRun, relative to the Text object (the first TextRun in the Text object is at index 0).

Returns:

A value specifying both the horizontal and vertical components of the advance width of a TextRun in user space.

Gets the advance width of a TextRun, in user space. The advance width is the amount by which the current point advances when the TextRun is drawn.

Advance width may be horizontal or vertical, depending on the writing style. Thus, the return value has both a horizontal and a vertical component.

getBoundingBox

RectgetBoundingBox()

Returns:

The bounding box for this element. The coordinates of the bounding box are specified in user space coordinates, relative to the element's Content. Note that user space coordinates correspond to unrotated pages; any rotation specified in the page dictionary is not taken into account.

The bounding box for this element.

The bounding box is a rectangle that is guaranteed to encompass the element, but it is not guaranteed to be the smallest box that could contain the element. For example, if the element is a Path that contains an arc, the bounding box encompasses the bezier control points, and not just the curve itself.

getBoundingBoxForCharacter

RectgetBoundingBoxForCharacter(intcharacterIndex)

Parameters

characterIndex: int

The index of a character, relative to the Text object (the first character in the Text object is at index 0)

Returns:

A Rect specifying the bounding box for the character.

The bounding box for a character in this text element.

getClip

ClipgetClip()

Returns:

- The current Clip for this Element.

Gets the current Clip for an Element.

getMatrix

MatrixgetMatrix()

Returns:

Matrix

The transformation matrix for the element.

getNumberOfCharacters

intgetNumberOfCharacters()

Returns:

int

The number of characters in this text element.

getNumberOfRuns

intgetNumberOfRuns()

Returns:

int

The number of text runs in this text element.

getRun

TextRungetRun(intindex)

Parameters

index: int

Returns:

TextRun

Obtains the TextRun at the specified index.

getTextMatrixForCharacter

MatrixgetTextMatrixForCharacter(intcharacterIndex)

Parameters

characterIndex: int

The index of a character, relative to the Text object (the first character in the Text object is at index 0).

Returns:

The transformation matrix for the character specified by characterIndex.

Gets the transformation matrix from user space to the current text space for the specified character. The H and V values of the matrix indicate the origin of the first character.

getTextMatrixForTextRun

MatrixgetTextMatrixForTextRun(inttextRunIndex)

Parameters

textRunIndex: int

The index of a TextRun, relative to the Text object (the first TextRun in the Text object is at index 0).

Returns:

The transformation matrix for the TextRun specified by TextRunIndex.

Gets the transformation matrix from user space to the current text space for the specified TextRun. The H and V values of the matrix indicate the origin of the first character.

pointIntersectsCharacter

booleanpointIntersectsCharacter(Pointp, intindex)

Parameters

p: Point

The point to test, in user space coordinates.

index: int

The index of the character. The first character in the Text has an index of 0.

Returns:

true if the point is on the character, false if the point is not on the character.

Tests whether a point is on a specified character within this Text object.

pointIntersectsTextRun

booleanpointIntersectsTextRun(Pointp, intindex)

Parameters

p: Point

The point to test, in user space coordinates.

index: int

The index of the TextRun. The first TextRun in the Text has an index of 0.

Returns:

true if the point is on the TextRun, false if the point is not on the TextRun.

Tests whether a point is on a specified TextRun within this Text object.

rectIntersectsCharacter

booleanrectIntersectsCharacter(Rectr, intindex)

Parameters

r: Rect

The rect to test, in user space coordinates.

index: int

The index of the character. The first character in the Text has an index of 0.

Returns:

true if any part of the rectangle is on the character, false if no part of the rectangle is on the character.

Tests whether any part of a rectangle is on a specified character within this Text object.

rectIntersectsTextRun

booleanrectIntersectsTextRun(Rectr, intindex)

Parameters

r: Rect

The rect to test, in user space coordinates.

index: int

The index of the TextRun. The first TextRun in the Text has an index of 0.

Returns:

true if any part of the rectangle is on the TextRun, false if no part of the rectangle is on the TextRun.

Tests whether any part of a rectangle is on a specified TextRun within this Text object.

removeRuns

voidremoveRuns(intindex, intcount)

Parameters

index: int

Start position of range to delete

count: int

Count of TextRuns to delete

Returns:

void

Removes a count of TextRuns, starting from index

rotate

voidrotate(doubletheta)

Parameters

theta: double

Returns:

void

Rotate an element by T degrees counterclockwise units using the matrix [ cos T sin T -sin T cos T 0 0 ].

scale

voidscale(doublesx, doublesy)

Parameters

sx: double
sy: double

Returns:

void

Scale an element by (sx,sy) units using the matrix [ sx 0 0 sy 0 0 ].

setClip

voidsetClip(Clipclip)

Parameters

clip: Clip

The clip to set as the current clip for this element.

Returns:

void

Sets the current Clip for an Element.

setMatrix

voidsetMatrix(Matrixmatrix)

Parameters

matrix: Matrix

the transformation matrix for the element.

Returns:

void

Set the transformation matrix for the element.

splitTextRunAtCharacter

voidsplitTextRunAtCharacter(intsplitLocation)

Parameters

splitLocation: int

The split location, relative to the Text object.

Returns:

void

Splits the TextRun containing the character at the specified location into two contiguous TextRuns. The character at the specified index will be part of the first TextRun.

translate

voidtranslate(doubletx, doublety)

Parameters

tx: double
ty: double

Returns:

void

Translate an element by (tx,ty) units using the matrix [ 1 0 0 1 tx ty ].