TextFragment

Overview

TextFragment is a interface in Aspose.PDF FOSS for TypeScript.

A positioned text run sharing one font, size, and baseline — the public unit of structured extraction (Page.GetTextFragments).

Properties: angle, bold, fontName, fontSize, italic, quad, and 3 more.

Properties

NameTypeAccessDescription
text: stringReadThe fragment’s decoded text (includes any literal space glyphs).
quad: [number, number, number, number]ReadPage-space axis box [x0,y0,x1,y1]: x from the pen span, y baseline..baseline+size.
fontSize: numberReadEffective font size in page units.
fontName: stringReadThe producing font’s /BaseFont name, or undefined if the font has none.
bold: booleanReadTrue when the producing font declares itself bold / italic (see fontStyleOf, the single owner of that question).
italic: booleanReadGets the italic.
angle: numberReadBaseline angle in radians; absent when horizontal.
vertical: booleanReadTrue when the run is set vertically (/WMode 1): it reads top-to-bottom within quad, and its column orders right-to-left against its siblings.
script: 'sub' | 'super'ReadSet when this run reads as a sub- or superscript of its own line.