PDFium Delphi Component Docs

CharacterInfo method

Component: TPdf  ·  Unit: PDFium
Read the colour, font, bounds, and matrix of one extracted character in a single call.

Syntax

function CharacterInfo(Index: Integer): TPdfCharacterInfo;

IndexInteger. Zero-based character index on the current page, below CharacterCount. An out-of-range index raises EPdfError.
ResultTPdfCharacterInfo. Record with fill and stroke colours, font name and flags, loose bounds, text matrix, and the handle of the text object that drew the character.

Description

Gathers what would otherwise be several separate property reads. Optional groups carry a Has... flag - HasFillColor, HasStrokeColor, HasLooseBounds, HasMatrix - so absent information is distinguishable from a zero value

LooseBounds is the font-metric box of the glyph rather than the tight ink box CharacterRectangle reports, which makes it the better basis for line and word grouping. FontFlags carries the PDF font descriptor flags (ISO 32000-1 Table 123), so serif, italic, and symbolic faces can be told apart

TextObject ties the character back to the page object that drew it, which is how a caller reaches that object's attributes through PageObjectInfo

See Also

Character, CharacterRectangle, CharacterFontSize, GetStructuredText