PTTextExtractorStyle

@interface PTTextExtractorStyle : NSObject

A class representing predominant text style associated with a given Line, a Word, or a Glyph. The class includes information about the font, font size, font styles, text color, etc.

  • Declaration

    Objective-C

    - (PTObj *)GetFont;

    Swift

    func getFont() -> PTObj!

    Return Value

    low-level PDF font object. A high level font object can be instantiated as follows: In C++: pdftron.PDF.Font f(style.GetFont()) In C#: pdftron.PDF.Font f = new pdftron.PDF.Font(style.GetFont());

  • Declaration

    Objective-C

    - (NSString *)GetFontName;

    Swift

    func getFontName() -> String!

    Return Value

    the font name used to draw the selected text.

  • Note

    Unlike the ‘font size’ in the graphics state (pdftron.PDF.GState) the returned font size accounts for the effects CTM, text matrix, and other graphics state attributes that can affect the appearance of text.

    Declaration

    Objective-C

    - (double)GetFontSize;

    Swift

    func getFontSize() -> Double

    Return Value

    The font size used to draw the selected text as it appears on the output page.

  • Declaration

    Objective-C

    - (int)GetWeight;

    Swift

    func getWeight() -> Int32

    Return Value

    The weight (thickness) component of the fully-qualified font name or font specifier. The possible values are 100, 200, 300, 400, 500, 600, 700, 800, or 900, where each number indicates a weight that is at least as dark as its predecessor. A value of 400 indicates a normal weight; 700 indicates bold. Note: The specific interpretation of these values varies from font to font. For example, 300 in one font may appear most similar to 500 in another.

  • Note

    the return value corresponds to the state of ‘italic’ flag in the ‘Font Descriptor’.

    Declaration

    Objective-C

    - (BOOL)IsItalic;

    Swift

    func isItalic() -> Bool

    Return Value

    true if glyphs have dominant vertical strokes that are slanted.

  • Note

    the return value corresponds to the state of ‘serif’ flag in the ‘Font Descriptor’.

    Declaration

    Objective-C

    - (BOOL)IsSerif;

    Swift

    func isSerif() -> Bool

    Return Value

    true if glyphs have serifs, which are short strokes drawn at an angle on the top and bottom of glyph stems.

  • Declaration

    Objective-C

    - (NSArray<NSNumber *> *)GetColor;

    Swift

    func getColor() -> [NSNumber]!

    Return Value

    text color in RGB color space.

  • Undocumented

    Declaration

    Objective-C

    - (BOOL)isEqualTo: (PTTextExtractorStyle*)s;

    Swift

    func isEqual(to s: PTTextExtractorStyle!) -> Bool
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()