PDFium Component Docs

SpokenToPageChar-funktio

Unit: PDFium
Muuntaa puhutun tekstin merkkisiirtymän takaisin lähdesivuksi ja FTextPage-merkkikohdaksi

Syntax

function SpokenToPageChar(const Spoken: TPdfSpokenText; SpokenOffset: Integer; out Page, CharIndex: Integer): Boolean;

Parameters

SpokenTPdfSpokenText - Spoken text and span mapping
SpokenOffsetInteger - Zero-based character offset in Spoken.Text
PageInteger - Receives the one-based source page number
CharIndexInteger - Receives the zero-based FTextPage character index

Return Value

True when the offset maps to a source range, otherwise False

Description

The function scans the span table and returns the page and source character index owned by the first span that covers the spoken offset

Offsets that land on an unmapped separator before a mapped run clamp to that run's first source character; spoken runs longer than the source range clamp to the last source character

Remarks

Example

if SpokenToPageChar(Spoken, SpokenOffset, PageNumber, CharIndex) then
  PdfView1.TrackReadingWordAt(PageNumber, CharIndex);

See Also

TPdfSpokenText, TPdfView.TrackReadingWordAt, TPdfReadingSession.FeedSpokenPosition