PTSelection
@interface PTSelection : NSObject
A class representing the current text selection.
-
Declaration
Objective-C
- (int)GetPageNum;
Swift
func getPageNum() -> Int32
Return Value
the page number containing the selected text.
-
Returns the list of tight bounding quads in the current text selection.
e.g., (quad[0], quad[1]) is the coordinate of vertex 0, and (quad[4], quad[5]) is the coordinate of vertex 2. Note that it is only ensured that the four vertices are arranged sequentially; it is possible in practice that (quad[0], quad[1]) is the coordinate of any vertex.
Note
the ‘quads’ array is owned by the current selection and does not need to be explicitly released.
Declaration
Objective-C
- (PTVectorQuadPoint *)GetQuads;
Swift
func getQuads() -> PTVectorQuadPoint!
Parameters
quads
- Sets a pointer to an array of vertices representing a list of bounding quads for the selected text. Each bounding quad is represented using 8 numbers in an array of doubles. Each two consecutive values represent the x and y coordinates of a quad vertex and the four vertices are arranged counter-clockwisely,
3--------2 | | | | | | 0--------1
Return Value
the number of quads in ‘quads’ array.
-
Declaration
Objective-C
- (NSString *)GetAsUnicode;
Swift
func getAsUnicode() -> String!
Return Value
the current text selection represented as an Unicode string.
-
Note
this function can be used to implement clipboard copy and paste that preserves text formating.Declaration
Objective-C
- (NSString *)GetAsHtml;
Swift
func getAsHtml() -> String!
Return Value
the current text selection in HTML format. HTML text will contain styling information such as text color, font size, style etc.
-
Undocumented
Declaration
Objective-C
- (instancetype)init;
Swift
init!()