DL Logo

PDEText Enumerations

PDETextFlags

Header: PEExpT.h:1736

Description

A bit field used in PDEText methods.

Enum Constants

kPDETextRun=0x0001
Text run.
kPDETextChar=0x0002
Character (text run with only one character).
kPDETextPageSpace=0x0004
Obtain the advance width in page space.
kPDETextGetBounds=0x0008
Fill in the left and right bounds of the text run's bounding box.
kPDETextPreciseQuad=0x0010

PDETextRenderMode

Header: PEExpT.h:1760

Description

Flags indicating text rendering mode set by the Tr operator.

Related Methods

Enum Constants

kPDETextFill
Fill text.
kPDETextStroke
Stroke text.
kPDETextFillAndStroke
Fill and stroke text.
kPDETextInvisible
Text with no fill and no stroke (invisible).

PDETextStateWasSetFlags

Header: PEExpT.h:678

Description

A structure describing the text state that was set.

Enum Constants

kPDECharSpacingWasSet=0x0001
Character spacing was set corresponding to the Tc operator.
kPDEWordSpacingWasSet=0x0002
Word spacing was set corresponding to the Tw operator.
kPDERenderModeWasSet=0x0004
Text rendering mode was set corresponding to the Tr operator.
kPDEFontSizeWasSet=0x0008
Font size was set corresponding to the Tf operator.
kPDEHScaleWasSet=0x0010
Horizontal Scaling was set corresponding to the Tz operator.
kPDETextRiseWasSet=0x0020
Text rise was set corresponding to the Ts operator.

PDEText Typedefs

PDEText

Header: PEExpT.h:166

Description

A PDEElement representing text. It is a container for text as show strings or as individual characters. Each sub-element may have different graphics state properties. However, the same clip applies to all sub-elements of a PDEText. Also, the charpath of a PDEText can be used to represent a clip.

Related Methods

Syntax

typedef struct _t_PDEText *PDEText;

Returned From

Used By

PDETextItem

Header: PEExpT.h:411

Description

A reference to a PDETextItem.

Syntax

typedef struct _t_PDETextItem *PDETextItem;

Returned From

Used By

PDEText Structures

_t_PDETextState

Header: PEExpT.h:859

Description

Attributes of a PDEText element. To learn more about Text Rise, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 247. You can find this document on the web store of the International Standards Organization (ISO).

Syntax

struct _t_PDETextState {
ASUns32 wasSetFlags;
PDETextStateWasSetFlags indicates whether an attribute has been set.
ASFixed charSpacing;
Character spacing was set corresponding to the Tc operator.
ASFixed wordSpacing;
Word spacing corresponding to the Tw operator.
ASInt32 renderMode;
Text rendering mode corresponding to the Tr operator.
ASFixed fontSize;
Default is 1.
ASFixed hScale;
Default is 100 (meaning 100%).
ASFixed textRise;
Specifies the distance, in text space units that are not scaled, to move the baseline up or down from its default location. See the description of Text Rise in the ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 9.3.7, page 247.
} PDETextState, *PDETextStateP;

Used By

PDEText Functions

PDETextAdd

Header: PEWProcs.h:384

Description

Superseded by PDETextAddEx() in Acrobat 10.0. Adds a character or a text run to a PDEThe text object.

Note: This method does not change the reference count of pdeText; however, the reference count of the objects in the gstateP parameter are incremented.

Syntax

void PDETextAdd(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, IN ASUns8 *text, IN ASInt32 textLen, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASFixedMatrixP textMatrixP, IN ASFixedMatrixP strokeMatrixP);

Parameters

pdeText
The text object to which a character or text run is added.
flags
A PDETextFlags that specifies what kind of text to add. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index after which to add the character or text run.
text
A pointer to the characters to add. Note that passing NULL for the text can invalidate the text object, but will not raise an error. Callers must not pass NULL for this parameter.
textLen
The length of the text in bytes.
font
The font for the element.
gstateP
A pointer to a PDEGraphicStateP structure with the graphics state for the element.
gstateLen
The length of the graphics state for the element.
tstateP
A pointer to a PDETextState structure with the text state for the element. Note that PDFEdit ignores the wasSetFlags flag of the PDETextState structure, so you must initialize the PDETextState fields.
tstateLen
The length of the text state for the element.
textMatrixP
A pointer to an ASFixedMatrix that holds the matrix for the element.
strokeMatrixP
A pointer to an ASFixedMatrix that holds the matrix for the line width when stroking text. It may be NULL. Note that this field is not currently used.

Exceptions

PDETextAddEx

Header: PEWProcs.h:3651

Description

Adds a character or a text run to a PDEThe text object. Supersedes PDETextAdd() in Acrobat 10.0.

Note: This method does not change the reference count of pdeText; however, the reference count of the objects in the gstateP parameter are incremented.

Syntax

void PDETextAddEx(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, IN ASUns8 *text, IN ASInt32 textLen, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASDoubleMatrixP textMatrixP, IN ASDoubleMatrixP strokeMatrixP);

Parameters

pdeText
The text object to which a character or text run is added.
flags
A PDETextFlags that specifies what kind of text to add. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index after which to add the character or text run.
text
A pointer to the characters to add. Note that passing NULL for the text can invalidate the text object, but will not raise an error. Callers must not pass NULL for this parameter.
textLen
The length of the text in bytes.
font
The font for the element.
gstateP
A pointer to a PDEGraphicStateP structure with the graphics state for the element.
gstateLen
The length of the graphics state for the element.
tstateP
A pointer to a PDETextState structure with the text state for the element. Note that PDFEdit ignores the wasSetFlags flag of the PDETextState structure, so you must initialize the PDETextState fields.
tstateLen
The length of the text state for the element.
textMatrixP
A pointer to an ASDoubleMatrix that holds the matrix for the element.
strokeMatrixP
A pointer to an ASDoubleMatrix that holds the matrix for the line width when stroking text. It may be NULL. Note that this field is currently not used.

Exceptions

PDETextAddGlyphs

Header: PEWProcs.h:2642

Description

Superseded by PDETextAddGlyphsEx() in Acrobat 10.0. Adds Unicode text to a PDEText object.

Note: This method does not change the reference count of pdeText; however, the reference count of the objects in the gstateP parameter are incremented.

Syntax

void PDETextAddGlyphs(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, IN PDEGlyphRunP glyphRun, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASFixedMatrixP textMatrixP, IN ASFixedMatrixP strokeMatrixP);

Parameters

pdeText
The text object to which a character or text run is added.
flags
A PDETextFlags that specifies what kind of text to add. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index after which to add the character or text run.
glyphRun
A pointer to a PDEGlyphRun structure with Unicode data, GlyphIDs and their correspondence.
font
The font for the element.
gstateP
A pointer to a PDEGraphicStateP structure with the graphics state for the element.
gstateLen
The length of the graphics state for the element.
tstateP
A pointer to a PDETextState structure with text state for the element. Note that PDFEdit ignores the wasSetFlags flag of the PDETextState structure, so you must initialize the PDETextState fields.
tstateLen
The length of the text state for the element.
textMatrixP
A pointer to an ASFixedMatrix that holds the matrix for the element.
strokeMatrixP
A pointer to an ASFixedMatrix that holds the matrix for the line width when stroking text. It may be NULL. Note that, currently, this field is not used.

Exceptions

PDETextAddGlyphsEx

Header: PEWProcs.h:3595

Description

Adds Unicode text to a PDEText object. Supersedes PDETextAddGlyphs() in Acrobat 10.0.

Note: This method does not change the reference count of pdeText; however, the reference count of the objects in the gstateP parameter are incremented.

Syntax

void PDETextAddGlyphsEx(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, IN PDEGlyphRunP glyphRun, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASDoubleMatrixP textMatrixP, IN ASDoubleMatrixP strokeMatrixP);

Parameters

pdeText
The text object to which a character or text run is added.
flags
A PDETextFlags that specifies what kind of text to add. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index after which to add the character or text run.
glyphRun
A pointer to a PDEGlyphRun structure with Unicode data, GlyphIDs and their correspondence.
font
The font for the element.
gstateP
A pointer to a PDEGraphicStateP structure with the graphics state for the element.
gstateLen
The length of the graphics state for the element.
tstateP
A pointer to a PDETextState structure with text state for the element. Note that PDFEdit ignores the wasSetFlags flag of the PDETextState structure, so you must initialize the PDETextState fields.
tstateLen
The length of the text state for the element.
textMatrixP
A pointer to an ASDoubleMatrix that holds the matrix for the element.
strokeMatrixP
A pointer to an ASDoubleMatrix that holds the matrix for the line width when stroking text. It may be NULL. Note that this field is currently not used.

Exceptions

PDETextAddItem

Header: PEWProcs.h:2551

Description

Adds a text item to a text element at a given index position.

Syntax

void PDETextAddItem(IN PDEText text, IN ASInt32 addIndex, IN PDETextItem textItem);

Parameters

text
The text object to which the text item is added.
addIndex
The index of the text item in pdeText.
textItem
The text item to add.

Exceptions

PDETextCreate

Header: PEWProcs.h:436

Description

Creates an empty text object.

Call PDERelease() to dispose of the returned text object when finished with it.

Syntax

PDEText PDETextCreate(void);

Returns

An empty text object.

PDETextGetAdvance

Header: PERProcs.h:2542

Description

Gets the advance width of a character or a text element. Advance width is returned in either character space or 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 advanceP has both a horizontal and vertical component.

Related Methods

Syntax

void PDETextGetAdvance(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar, kPDETextPageSpace */ IN ASInt32 index, OUT ASFixedPointP advanceP);

Parameters

pdeText
A text object containing a character or text run whose advance width is found.
flags
A PDETextFlags value that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.

In addition, set the kPDETextPageSpace flag to obtain the advance width in user space. If it is not set, the advance width is in character space. If this flag is not set, this method returns a value that is independent of any sizes, matrices, or scaling, simply adding up the font's raw glyph widths, supplemented only by unscaled character and word spacing.

index
The index of the character or text run in pdeText.
advanceP
(Filled by the method) A pointer to a ASFixedPoint value indicating the advance width.

Exceptions

PDETextGetAdvanceWidth

Header: PERProcs.h:614

Description

Gets the advance width of a character or a text element. Advance width is returned in either character space or 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 advanceP has both a horizontal and vertical component.

Syntax

void PDETextGetAdvanceWidth(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar, kPDETextPageSpace */ IN ASInt32 index, OUT ASFixedPointP advanceP);

Parameters

pdeText
A text object containing a character or text run whose advance width is found.
flags
A PDETextFlags value that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.

In addition, set the kPDETextPageSpace flag to obtain the advance width in user space. If it is not set, the advance width is in character space. If this flag is not set, this method returns a value that is independent of any sizes, matrices, or scaling, simply adding up the font's raw glyph widths, supplemented only by unscaled character and word spacing.

index
The index of the character or text run in pdeText.
advanceP
(Filled by the method) A pointer to a ASFixedPoint value indicating the advance width.

Exceptions

PDETextGetBBox

Header: PERProcs.h:399

Description

Gets the bounding box of a character or a text run.

Syntax

void PDETextGetBBox(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT ASFixedRectP bboxP);

Parameters

pdeText
IN/OUT A text object containing a character or text run whose bounding box is found.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
bboxP
IN/OUT (Filled by the method) A pointer to ASFixedRect to set to the bounding box of specified character or text run.

Exceptions

PDETextGetFont

Header: PERProcs.h:501

Description

Gets the font for a text character or element.

Note: This method does not change the reference count of the returned PDEFont.

Related Methods

Syntax

PDEFont PDETextGetFont(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index);

Parameters

pdeText
IN/OUT A text object containing a character or text run whose font is found.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.

Returns

The font of the specified character or text run.

Exceptions

PDETextGetGState

Header: PERProcs.h:433

Description

Gets the graphics state of a character or a text run.

Note: This method does not increment the reference count of the objects in stateP.

Syntax

void PDETextGetGState(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize);

Parameters

pdeText
A text object containing a character or text run whose graphics state is found.
flags
A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index of the character or text run in pdeText.
stateP
(Filled by the method) A pointer to a PDEGraphicState structure with the graphics state of the specified character or text run.
stateSize
The size of the stateP buffer in bytes.

Exceptions

PDETextGetGStateEx

Header: PERProcs.h:3317

Description

Gets the graphics state of a character or a text run. This method fills PDEGraphicStateEx as output which is higher precision alternative of PDEGraphicState structure.

Note: This method does not increment the reference count of the objects in stateP.

Syntax

void PDETextGetGStateEx(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize);

Parameters

pdeText
A text object containing a character or text run whose graphics state is found.
flags
A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index of the character or text run in pdeText.
stateP
(Filled by the method) A pointer to a PDEGraphicStateExP structure with the graphics state of the specified character or text run.
stateSize
The size of the stateP buffer in bytes.

Exceptions

PDETextGetItem

Header: PERProcs.h:2661

Description

Obtains a text item from a text element at a given index position.

Syntax

PDETextItem PDETextGetItem(IN PDEText text, IN ASUns32 index);

Parameters

text
Text object from which the text item is obtained.
index
The index of the text item in pdeText.

Returns

The text item object.

Exceptions

PDETextGetMatrix

Header: PERProcs.h:2354

Description

Superseded by PDETextGetMatrixEx() in Acrobat 10.0. Returns the matrix of a character or a text element. Unlike PDETextGetTextMatrix(), this function does not take fontSize, hScale, and textRise in the textState into account.

Syntax

void PDETextGetMatrix(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT ASFixedMatrixP matrixP);

Parameters

pdeText
IN/OUT A text object containing a character or text run whose graphics state is found.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
matrixP
IN/OUT (Filled by the method) An ASFixedMatrixP that holds the matrix of the specified character or text run.

Exceptions

PDETextGetMatrixEx

Header: PERProcs.h:3184

Description

Supersedes PDETextGetMatrix() in Acrobat 10.0. Returns the matrix of a character or a text element. Unlike PDETextGetTextMatrixEx(), this function does not take fontSize, hScale, and textRise in the textState into account.

Syntax

void PDETextGetMatrixEx(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT ASDoubleMatrixP matrixP);

Parameters

pdeText
IN/OUT A text object containing a character or text run whose graphics state is found.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
matrixP
IN/OUT (Filled by the method) An ASDoubleMatrixP that holds the matrix of the specified character or text run.

Exceptions

PDETextGetNumBytes

Header: PERProcs.h:1629

Description

Gets the number of bytes occupied by the character code or text run.

Related Methods

Syntax

ASInt32 PDETextGetNumBytes(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun or kPDETextChar */ IN ASInt32 index);

Parameters

pdeText
IN/OUT A PDEText object returned from one of the PDETextCreate methods whose text is examined.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.

Returns

The number of bytes occupied by the text run or character.

Exceptions

PDETextGetNumChars

Header: PERProcs.h:306

Description

Gets the number of characters in a text object.

Syntax

ASInt32 PDETextGetNumChars(IN PDEText pdeText);

Parameters

pdeText
IN/OUT A text object whose number of characters is found.

Returns

The total number of characters in pdeText.

Exceptions

PDETextGetNumRuns

Header: PERProcs.h:320

Description

Gets the number of text runs (show strings) in a text object.

Syntax

ASInt32 PDETextGetNumRuns(IN PDEText pdeText);

Parameters

pdeText
IN/OUT A text object whose number of text runs is found.

Returns

The number of text runs in pdeText.

Exceptions

PDETextGetQuad

Header: PERProcs.h:1367

Description

Gets the quad bounding the specified text run or character.

The advance portion of the quad is based on the left side bearing and advance width.

Syntax

void PDETextGetQuad(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar, kPDETextBounding */ IN ASInt32 index, OUT ASFixedQuadP quadP);

Parameters

pdeText
IN/OUT A text object containing a character or text run whose quad is found.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.

In addition, if the kPDETextBounding flag is set, PDETextGetQuad() uses the font descriptor's FontBBox, which is the smallest rectangle that encloses all characters in the font. The advance portion is based on the x-coordinates of the left and right sides of FontBBox and the advance width.

index
IN/OUT The index of the character or text run in pdeText.
quadP
IN/OUT (Filled by the method) A pointer to ASFixedQuad that bounds the specified character or text run.

Exceptions

PDETextGetRunForChar

Header: PERProcs.h:354

Description

Gets the index of the text run that contains the nth character in a text object.

Syntax

ASInt32 PDETextGetRunForChar(IN PDEText pdeText, IN ASInt32 charIndex);

Parameters

pdeText
IN/OUT A text object to examine.
charIndex
IN/OUT The number of the character to find in pdeText.

Returns

The index of the text run with the specified character index into pdeText.

Exceptions

PDETextGetState

Header: PERProcs.h:2250

Description

Returns the text state of a character or a text element.

Syntax

void PDETextGetState(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT PDETextStateP stateP, IN ASUns32 stateSize);

Parameters

pdeText
IN/OUT A text object containing a character or text run whose text state is found.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
stateP
IN/OUT (Filled by the method) A pointer to a PDETextState structure to fill with the text state of the specified character or text run.
stateSize
IN/OUT The size of the stateP buffer in bytes.

Exceptions

PDETextGetStrokeMatrix

Header: PERProcs.h:572

Description

Superseded by PDETextGetStrokeMatrixEx() in Acrobat 10.0. Gets the stroke matrix of a character or a text run.

Note: This method returns no valid information.

Syntax

void PDETextGetStrokeMatrix(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT ASFixedMatrixP matrixP);

Parameters

pdeText
A text object containing a character or text run whose stroke matrix is found.
flags
A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index of the character or text run in pdeText.
matrixP
(Filled by the method) A pointer to ASFixedMatrix that holds the stroke matrix of the specified character or text run. This matrix is the transformation for line widths when stroking. The h and v values of the matrix are ignored.

Exceptions

PDETextGetStrokeMatrixEx

Header: PERProcs.h:3115

Description

Supersedes PDETextGetStrokeMatrix() in Acrobat 10.0. Gets the stroke matrix of a character or a text run.

Note: This method returns no valid information.

Syntax

void PDETextGetStrokeMatrixEx(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT ASDoubleMatrixP matrixP);

Parameters

pdeText
A text object containing a character or text run whose stroke matrix is found.
flags
A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index of the character or text run in pdeText.
matrixP
(Filled by the method) A pointer to ASDoubleMatrix that holds the stroke matrix of the specified character or text run. This matrix is the transformation for line widths when stroking. The h and v values of the matrix are ignored.

Exceptions

PDETextGetText

Header: PERProcs.h:647

Description

Gets the text for a text run or character.

Syntax

ASInt32 PDETextGetText(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT ASUns8 *textBuffer);

Parameters

pdeText
IN/OUT A text object containing a character or text run whose text is found.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
textBuffer
IN/OUT (Filled by the method) The text of the specified character or text run. textBuffer must be large enough to hold the returned text. If textBuffer is NULL, it returns the number of bytes required to hold the data.

Returns

The number of bytes in the text run or character.

Exceptions

PDETextGetTextMatrix

Header: PERProcs.h:537

Description

Superseded by PDETextGetTextMatrixEx() in Acrobat 10.0. Gets the matrix of a character or a text run.

Syntax

void PDETextGetTextMatrix(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT ASFixedMatrixP matrixP);

Parameters

pdeText
A text object containing a character or text run whose matrix is found.
flags
A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index of the character or text run in pdeText.
matrixP
(Filled by the method) A pointer to ASFixedMatrix that holds the matrix of the specified character or text run. This is the transformation matrix from user space to the current text space. The h and v values of the matrix indicate the origin of the first character.

Exceptions

PDETextGetTextMatrixEx

Header: PERProcs.h:3080

Description

Supersedes PDETextGetTextMatrix() in Acrobat 10.0. Gets the matrix of a character or a text run.

Syntax

void PDETextGetTextMatrixEx(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT ASDoubleMatrixP matrixP);

Parameters

pdeText
A text object containing a character or text run whose matrix is found.
flags
A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
The index of the character or text run in pdeText.
matrixP
(Filled by the method) A pointer to ASDoubleMatrix that holds the matrix of the specified character or text run. This is the transformation matrix from user space to the current text space. The h and v values of the matrix indicate the origin of the first character.

Exceptions

PDETextGetTextState

Header: PERProcs.h:469

Description

Gets the text state of a character or a text element.

Note: This function handles only charSpacing, wordSpacing, and renderMode for backward compatibility. For all attributes, use PDETextGetState() instead.

Syntax

void PDETextGetTextState(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, OUT PDETextStateP stateP, IN ASUns32 stateSize);

Parameters

pdeText
IN/OUT A text object containing a character or text run whose text state is found.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
stateP
IN/OUT (Filled by the method) A pointer to a PDETextState structure to fill with the text state of the specified character or text run.
stateSize
IN/OUT The size of the stateP buffer in bytes.

Exceptions

PDETextIsAtPoint

Header: PERProcs.h:1742

Description

Tests whether a point is on specified text. It checks if the point is in a bounding box for the PDEText.

Syntax

ASBool PDETextIsAtPoint(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, IN ASFixedPoint point);

Parameters

pdeText
IN/OUT The text to test.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
point
IN/OUT The point, specified in user space coordinates.

Returns

true if the point is on the text, false otherwise.

PDETextIsAtRect

Header: PERProcs.h:1772

Description

Tests whether any part of a rectangle is on the specified text.

Syntax

ASBool PDETextIsAtRect(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, IN ASFixedRect rect);

Parameters

pdeText
IN/OUT The text to test.
flags
IN/OUT A PDETextFlags flag that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
rect
IN/OUT The rectangle, specified in user space coordinates.

Returns

true if the text is on the rectangle, false otherwise.

PDETextRemove

Header: PEWProcs.h:422

Description

Removes characters or text runs from a text object.

Note: This method decrements the reference count of objects associated with the pdeText in the graphic state and font.

Syntax

void PDETextRemove(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, IN ASInt32 count);

Parameters

pdeText
IN/OUT The text object from which text is removed.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
count
IN/OUT The number of characters or text runs to remove.

Exceptions

PDETextRemoveItems

Header: PEWProcs.h:2568

Description

Removes contiguous text items from a text element starting at a given index position.

Syntax

void PDETextRemoveItems(IN PDEText text, IN ASUns32 index, IN ASUns32 count);

Parameters

text
The text object from which the text items are removed.
index
The index of the first text item in pdeText to remove.
count
The number of text items to remove.

Exceptions

PDETextReplaceChars

Header: PEWProcs.h:1312

Description

Replaces characters in a text object.

This method does not change the number of characters in the text object; extra characters are ignored.

Syntax

void PDETextReplaceChars(IN PDEText pdeText, IN ASUns32 flags, /* kPDETextRun, kPDETextChar */ IN ASInt32 index, IN ASUns8 *textBuffer, IN ASInt32 numChars);

Parameters

pdeText
IN/OUT The text object in which characters are replaced.
flags
IN/OUT A PDETextFlags that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values:
Value
Description
Used for a text character.
Used for a text run.
index
IN/OUT The index of the character or text run in pdeText.
textBuffer
IN/OUT Replacement text.
numChars
IN/OUT The number of bytes to replace.

Exceptions

PDETextRunGetCharOffset

Header: PERProcs.h:339

Description

Gets the character offset of the first character of the specified text run.

Syntax

ASInt32 PDETextRunGetCharOffset(IN PDEText pdeText, IN ASInt32 runIndex);

Parameters

pdeText
IN/OUT A text object containing a character or text run whose graphics state is found.
runIndex
IN/OUT The index of the text run whose first character's index is returned.

Returns

The character offset of the first character of the specified text run in pdeText.

Exceptions

PDETextRunGetNumChars

Header: PERProcs.h:371

Description

Gets the number of characters in a text run.

Syntax

ASInt32 PDETextRunGetNumChars(IN PDEText pdeText, IN ASInt32 runIndex);

Parameters

pdeText
IN/OUT A text object containing a text run whose number of characters is found.
runIndex
IN/OUT The index of the text run whose number of characters is returned.

Returns

The number of characters in the specified text run.

Exceptions

PDETextRunSetFont

Header: PEWProcs.h:294

Description

Sets the font of a text run.

Note: This method decrements the reference count of the previous font and increments the reference count of the new font.

Related Methods

Syntax

void PDETextRunSetFont(IN PDEText pdeText, IN ASInt32 runIndex, IN PDEFont font);

Parameters

pdeText
IN/OUT The text object containing a text run whose font is set.
runIndex
IN/OUT The index of the text run.
font
IN/OUT The font set for the text run.

Exceptions

PDETextRunSetGState

Header: PEWProcs.h:250

Description

Sets the graphics state of a text run.

Note: This method increments the reference count of objects in stateP.

Syntax

void PDETextRunSetGState(IN PDEText pdeText, IN ASInt32 runIndex, IN PDEGraphicStateP stateP, IN ASUns32 stateSize);

Parameters

pdeText
The text object containing a text run whose graphics state is set.
runIndex
The index of the text run.
stateP
A pointer to a PDEGraphicState structure with the graphics state to set.
stateSize
The size of the stateP buffer in bytes.

Exceptions

PDETextRunSetGStateEx

Header: PEWProcs.h:3803

Description

Sets the graphics state of a text run. This method takes pointer to PDEGraphicStateEx as input which is higher precision alternative of PDEGraphicState structure.

Note: This method increments the reference count of objects in stateP.

Syntax

void PDETextRunSetGStateEx(IN PDEText pdeText, IN ASInt32 runIndex, IN PDEGraphicStateExP stateP, IN ASUns32 stateSize);

Parameters

pdeText
The text object containing a text run whose graphics state is set.
runIndex
The index of the text run.
stateP
A pointer to a PDEGraphicStateEx structure with the graphics state to set.
stateSize
The size of the stateP buffer in bytes.

Exceptions

PDETextRunSetMatrix

Header: PEWProcs.h:2274

Description

Superseded by PDETextRunSetMatrixEx() in Acrobat 10.0. Sets the matrix of a text run. Unlike PDETextRunSetTextMatrix(), this function does not change fontSize, hScale, and textRise in the textState of PDEText.

Syntax

void PDETextRunSetMatrix(IN PDEText pdeText, IN ASInt32 runIndex, IN ASFixedMatrixP matrixP);

Parameters

pdeText
IN/OUT The text object containing a text run.
runIndex
IN/OUT The index of the text run.
matrixP
IN/OUT ASFixedMatrixP pointer.

Exceptions

PDETextRunSetMatrixEx

Header: PEWProcs.h:3714

Description

Sets the matrix of a text run. Supersedes PDETextRunSetMatrix() in Acrobat 10.0. Unlike PDETextRunSetTextMatrixEx(), this function does not change fontSize, hScale, and textRise in the textState of PDEText.

Syntax

void PDETextRunSetMatrixEx(IN PDEText pdeText, IN ASInt32 runIndex, IN ASDoubleMatrixP matrixP);

Parameters

pdeText
IN/OUT The text object containing a text run.
runIndex
IN/OUT The index of the text run.
matrixP
IN/OUT ASDoubleMatrixP pointer.

Exceptions

PDETextRunSetState

Header: PEWProcs.h:2086

Description

Sets the text state of a text run.

Related Methods

Syntax

void PDETextRunSetState(IN PDEText pdeText, IN ASInt32 runIndex, IN PDETextStateP stateP, IN ASUns32 stateSize);

Parameters

pdeText
The text object containing a text run whose state is set.
runIndex
The index of the text run.
stateP
A pointer to a PDETextState structure with the state to set.
stateSize
The size of the stateP buffer in bytes.

Exceptions

PDETextRunSetStrokeMatrix

Header: PEWProcs.h:332

Description

Superseded by PDETextRunSetStrokeMatrixEx() in Acrobat 10.0. Sets the stroke matrix of a text run.

Note: Currently this method is not implemented.

Syntax

void PDETextRunSetStrokeMatrix(IN PDEText pdeText, IN ASInt32 runIndex, IN ASFixedMatrixP matrixP);

Parameters

pdeText
The text object containing a text run whose stroke matrix is set.
runIndex
The index of the text run.
matrixP
A pointer to an ASFixedMatrix that holds the stroke matrix.

Exceptions

PDETextRunSetStrokeMatrixEx

Header: PEWProcs.h:3464

Description

Sets the stroke matrix of a text run. Supersedes PDETextRunSetStrokeMatrix() in Acrobat 10.0.

Note: Currently this method is not implemented (Acrobat 10 and later).

Syntax

void PDETextRunSetStrokeMatrixEx(IN PDEText pdeText, IN ASInt32 runIndex, IN ASDoubleMatrixP matrixP);

Parameters

pdeText
The text object containing a text run whose stroke matrix is set.
runIndex
The index of the text run.
matrixP
A pointer to an ASDoubleMatrix that holds the stroke matrix.

Exceptions

PDETextRunSetTextMatrix

Header: PEWProcs.h:313

Description

Superseded by PDETextRunSetTextMatrixEx() in Acrobat 10.0. Sets the text matrix of a text run.

Syntax

void PDETextRunSetTextMatrix(IN PDEText pdeText, IN ASInt32 runIndex, IN ASFixedMatrixP matrixP);

Parameters

pdeText
IN/OUT The text object containing a text run whose text matrix is set.
runIndex
IN/OUT The index of the text run.
matrixP
IN/OUT A pointer to an ASFixedMatrix that holds the text matrix.

Exceptions

PDETextRunSetTextMatrixEx

Header: PEWProcs.h:3445

Description

Sets the text matrix of a text run. Supersedes PDETextRunSetTextMatrix() in Acrobat 10.0.

Syntax

void PDETextRunSetTextMatrixEx(IN PDEText pdeText, IN ASInt32 runIndex, IN ASDoubleMatrixP matrixP);

Parameters

pdeText
IN/OUT The text object containing a text run whose text matrix is set.
runIndex
IN/OUT The index of the text run.
matrixP
IN/OUT A pointer to an ASDoubleMatrix that holds the text matrix.

Exceptions

PDETextRunSetTextState

Header: PEWProcs.h:275

Description

Sets the text state of a text run.

Note: This method has the following side effect: It modifies the text matrix of the run. In order to maintain backward compatibility, this method only directly operates on the first four fields of PDETextState. When it is called, it calculates a new text matrix with three additional fields: fontSize, hScale, and textRise (see PDETextState). To avoid this behavior, use PDETextRunSetState() instead (which was added to address this problem).

Syntax

void PDETextRunSetTextState(IN PDEText pdeText, IN ASInt32 runIndex, IN PDETextStateP stateP, IN ASUns32 stateSize);

Parameters

pdeText
The text object containing a text run whose text state is set.
runIndex
The index of the text run.
stateP
A pointer to a PDETextState structure with text state.
stateSize
The size of the stateP buffer in bytes.

Exceptions

PDETextSplitRunAt

Header: PEWProcs.h:1262

Description

Splits a text run into two text runs.

Syntax

void PDETextSplitRunAt(IN PDEText pdeText, IN ASInt32 splitLoc);

Parameters

pdeText
The text object containing a text run to split.
splitLoc
The split location, relative to the text object. The first text run is from character index 0 up to splitLoc. The second text run is from splitLoc + 1 to the end of the run.

Exceptions