Foxit PDF SDK

Instance Methods | Class Methods | Properties | List of all members
FSTextObject Class Reference
Inheritance diagram for FSTextObject:

## Instance Methods
(int) | - getCharCount
| Get character count in current text object. More...
(float) | - getCharHeightByIndex:
| Get the height of a character specified by index in current text object. More...
(FSPointF *) | - getCharPos:
| Get the position of a character specified by index in current text object. More...
(float) | - getCharWidthByIndex:
| Get the width of a character specified by index in current text object. More...
(FSTextState *) | - getTextState:
| Get text state information. More...
(void) | - setTextState:text_state:is_italic:weight:
| Set text state information. More...
Instance Methods inherited from FSGraphicsObject
(BOOL) | - addClipPath:fill_mode:
| Add a path for clipping. More...
(BOOL) | - addClipTextObject:
| Add text object for clipping. More...
(BOOL) | - clearClips
| Clear all clips. More...
(FSGraphicsObject *) | - clone
| Clone a new graphics object. More...
(FSGraphicsObject *) | - cloneWithSrcGraphicsobjects:dest_graphicsobjects:
| Clone a new graphics object. More...
(FSPath *) | - getClipPath:
| Get a path clip by index. More...
(int) | - getClipPathCount
| Get the count of path clip. More...
(FSFillMode) | - getClipPathFillMode:
| Get the fill mode of a path clip by index. More...
(FSTextObject *) | - getClipTextObject:
| Get the text object of a text clip by index. More...
(int) | - getClipTextObjectCount
| Get the count of text clip. More...
(FSFormXObject *) | - getFormXObject
| Get the form XObject graphics object if current graphics object represents a form XObject object. More...
(FSImageObject *) | - getImageObject
| Get the image graphics object if current graphics object represents an image object. More...
(FSLayerNodeArray *) | - getLayers:
| Get all the layers which are associated with current graphics object. More...
(FSMarkedContent *) | - getMarkedContent
| Get marked content object. More...
(FSPathObject *) | - getPathObject
| Get the path graphics object if current graphics object represents a path object. More...
(FSRectF *) | - getRect
| Get the rectangle of current graphics object. More...
(FSShadingObject *) | - getShadingObject
| Get the shading graphics object if current graphics object represents a shading object. More...
(FSTextObject *) | - getTextObject
| Get the text graphics object if current graphics object represents a text object. More...
(FSGraphicsObjectType) | - getType
| Get the type of current graphics object. More...
(BOOL) | - hasTransparency
| Check whether current graphics object has transparency or not. More...
(BOOL) | - removeClipPath:
| Remove a path clip by index. More...
(BOOL) | - removeClipTextObject:
| Remove a text clip by index for clipping. More...
(void) | - rotate:
| Rotate current graphics object from current state with specified angle degree in clockwise. More...
(BOOL) | - transform:need_transform_clippath:
| Transform current graphics object. More...

## Class Methods
(FSTextObject *) | + create
| Create a new text graphics object. More...

## Properties
NSString * | text
| Get or Set text string.
Properties inherited from FSGraphicsObject
FSGraphicsObjectBlendMode | blendMode
| Get or Set the blend mode for transparent imaging model.
FSRectF * | clipRect
| Get or Set clip rectangle.
FSColorState * | colorState
| Get or Set color state. More...
unsigned int | fillColor
| Get or Set the fill color. More...
float | fillOpacity
| Get or Set the opacity value for painting operations other than stroking.
FSGraphState * | graphState
| Get or Set graph state. More...
FSMatrix2D * | matrix
| Get or Set matrix.
unsigned int | strokeColor
| Get or Set the stroke color. More...
float | strokeOpacity
| Get or Set opacity value for stroke painting operations for paths and glyph outlines.

## Detailed Description

Text graphics object is a kind of PDF graphics object, so class FSTextObject is derived from class FSGraphicsObject . It offers functions to get/set text graphics object's data.
To create a new text graphics object, please use function FSTextObject::create and then use setting functions to set information to the new text graphics object.

See also
  FSGraphicsObject

## Method Documentation

## ◆ create()

+ (FSTextObject *) create |  |  |

Create a new text graphics object.

The newly created text graphics object does not have any data yet. Then, setting functions can be called to set data to the new text graphics object.

Returns
  A new text graphics object. If there is any error, this function will return nil.

## ◆ getCharCount()

- (int) getCharCount |  |  |

Get character count in current text object.

Returns
  Character count.

## ◆ getCharHeightByIndex:()

- (float) getCharHeightByIndex: |  | (int) | index |

Get the height of a character specified by index in current text object.

Parameters

  [in] | index | The index of character whose position is to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSTextObject::getCharCount.

Returns
  Height of the specified character.

## ◆ getCharPos:()

- (FSPointF *) getCharPos: |  | (int) | index |

Get the position of a character specified by index in current text object.

Parameters

  [in] | index | The index of character whose position is to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSTextObject::getCharCount.

Returns
  Position of the specified character, in PDF coordinate system.

## ◆ getCharWidthByIndex:()

- (float) getCharWidthByIndex: |  | (int) | index |

Get the width of a character specified by index in current text object.

Parameters

  [in] | index | The index of character whose position is to be retrieved. Valid range: from 0 to (count-1). count is returned by function FSTextObject::getCharCount.

Returns
  Width of the specified character.

## ◆ getTextState:()

- (FSTextState *) getTextState: |  | (FSPDFPage*) | page |

Get text state information.

Parameters

  [in] | page | A valid PDF page.Please ensure that current graphics object just belongs to this page.

Returns
  Text state information.

## ◆ setTextState:text_state:is_italic:weight:()

- (void) setTextState: |  | (FSPDFPage*) | page
text_state: |  | (FSTextState*) | text_state
is_italic: |  | (BOOL) | is_italic
weight: |  | (int) | weight

Set text state information.

Parameters

  [in] | page | A valid PDF page.Please ensure that current graphics object just belongs to this page.
  [in] | text_state | New text state information.
  [in] | is_italic | YES means the text of current graphics object is italic, while NO means not.
  [in] | weight | Original font weight. If the value is larger than 500, that means to use bold.

Returns
  None.

Note
  When this function succeeds, function FSGraphicsObjects::generateContent should be called. Please refer to function FSGraphicsObjects::generateContent for more details.