PDFium Delphi Component Docs

WordSegmentation property

Unit: PDFium
property WordSegmentation: TPdfWordSegmentation;

WordSegmentation defaults to wsmWhitespace, preserving the original space/tab/newline/NBSP tokenizer

Explicit wsmCjk provides deterministic tailored units: individual Han scalars, Hiragana runs, Katakana runs, Hangul runs, separate punctuation and script transitions, including fullwidth forms and Unicode whitespace

Recognized combining accents, voiced marks and variation selectors remain with the preceding unit; valid surrogate pairs are never split

This profile provides useful navigation units without a dictionary and is not linguistic Chinese/Japanese word recognition or full Unicode boundary-conformance; see Unicode text segmentation for the distinction between default boundaries and language-specific tailoring

Document, viewer and session modes are independent; change the applicable host before extracting or playing words

Viewer changes clear tracked/prefetched word geometry and the active cursor; session changes stop playback so the next chunk uses the selected mode

Native CJK word boxes include CharacterIndices, mapping each UTF-16 text unit to its native character index; StartIndex and Count remain native ranges, while pure BuildWordBoxes uses UTF-16 ranges

BuildSpokenTextFromWords preserves adjacent source units without inserting artificial spaces and emits exact source mappings from CharacterIndices; invalid explicit maps raise EPdfError