Class: TextExtractorStyle

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.<PDFNet.TextExtractorStyle>

compare(s)

Comparison function. Determines if parameter object is equal to current object.
Parameters:
Name Type Description
s 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.<PDFNet.TextExtractorStyle>

getColor()

Returns:
A promise that resolves to text color in RGB color space.
Type
Promise.<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.<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.
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.
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.
Type
Promise.<boolean>