THotPDF.AddPronunciationLexicon Method
Embeds a PLS pronunciation lexicon and appends its indirect file specification to the PDF 2.0 structure tree in lookup order
Declaration
function AddPronunciationLexicon(
const FileName, Description: AnsiString;
const LexiconBytes: TBytes): THPDFDictionaryObject;
Parameters and result
| Value | Purpose |
|---|---|
FileName | Non-empty embedded file name used by the Filespec and embedded-files name tree |
Description | Optional human-readable Filespec/Desc text |
LexiconBytes | Non-empty XML bytes conforming to Pronunciation Lexicon Specification 1.0 |
| Result | Indirect Filespec dictionary that owns the embedded lexicon reference |
Behavior
- The method requires PDF 2.0 and follows
StrictVersionLockbehavior - The payload is written as an indirect
EmbeddedFilestream withapplication/pls+xml, size, and modification-date metadata - The returned indirect
Filespecis appended toStructTreeRoot/PronunciationLexicon - Lexicon order is significant because text-to-speech consumers should use the first matching entry
ValidatePDFUA2Structurechecks array type, indirect references, embedded payloads, and MIME identity