PDFium Delphi Component Docs

SpokenTextAppend 程序

單元: PDFium
將一段已對應的朗讀文字區段附加到 TPdfSpokenText 區塊

語法

procedure SpokenTextAppend(var Spoken: TPdfSpokenText; const SpokenPart: WString; Page, StartIndex: Integer; SourceCount: Integer = -1);

參數

SpokenTPdfSpokenText - 接收朗讀文字與跨距項目的區塊
SpokenPartWString - 傳遞給語音引擎的文字連續段
PageInteger - 從 1 起始的來源頁碼
StartIndexInteger - 從 0 起始的 FTextPage 來源字元索引
SourceCountInteger - 來源字元計數,或 -1 以使用朗讀連續段長度

說明

SpokenTextAppend 會將 SpokenPart 新增至 Spoken.Text,並記錄一個將朗讀位移對應回頁面文字的 TPdfSpokenSpan

當 Spoken.Text 已有內容時,輔助函式會在新連續段前插入一個分隔空格;該分隔符號是刻意不對應的

備註

範例

Spoken.Text := '';
Spoken.Spans := nil;
SpokenTextAppend(Spoken, UnitText, 1, UnitStart, UnitLength);

另請參閱

TPdfSpokenText, SpokenToPageChar, BuildSpokenTextFromWords