Class: TextExtractorStyle

Core.PDFNet. TextExtractorStyle


new TextExtractorStyle( [mp_imp])

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.
Parameters:
Name Type Argument Description
mp_imp <optional>
Properties:
Name Type Description
mp_imp

Methods


<static> create()

Constructor
Returns:
A promise that resolves to an object of type: "PDFNet.TextExtractorStyle"
Type
Promise.<Core.PDFNet.TextExtractorStyle>

compare(s)

Comparison function. Determines if parameter object is equal to current object.
Parameters:
Name Type Description
s Core.PDFNet.TextExtractorStyle
Returns:
A promise that resolves to True if the two objects are equivalent, False otherwise
Type
Promise.<boolean>

copy()

Copy Constructor
Returns:
A promise that resolves to an object of type: "PDFNet.TextExtractorStyle"
Type
Promise.<Core.PDFNet.TextExtractorStyle>

getColor()

Returns:
A promise that resolves to text color in RGB color space.
Type
Promise.<Core.PDFNet.ColorPt>

getFont()

Returns:
A promise that resolves to 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());
Type
Promise.<Core.PDFNet.Obj>

getFontName()

Returns:
A promise that resolves to the font name used to draw the selected text.
Type
Promise.<string>

getFontSize()

Returns:
A promise that resolves to the font size used to draw the selected text as it appears on the output page. 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.
Type
Promise.<number>

getWeight()

Returns:
A promise that resolves to 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.
Type
Promise.<number>

isItalic()

Returns:
A promise that resolves to true if glyphs have dominant vertical strokes that are slanted. Note: the return value corresponds to the state of 'italic' flag in the 'Font Descriptor'.
Type
Promise.<boolean>

isSerif()

Returns:
A promise that resolves to true if glyphs have serifs, which are short strokes drawn at an angle on the top and bottom of glyph stems. Note: the return value corresponds to the state of 'serif' flag in the 'Font Descriptor'.
Type
Promise.<boolean>