Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfHyphenationLexicon

OfficeIMO.Pdf

Namespace
OfficeIMO.Pdf
Assembly
OfficeIMO.Pdf
Source revision
67621aa8a46e with working tree changes
Modifiers
sealed

Immutable, dependency-free dictionary of language-specific word hyphenation points.

Inheritance

  • object
  • PdfHyphenationLexicon

Remarks

Entries use an explicit marker, for example typog-ra-phy. The marker is removed from lookup text and its UTF-16 position becomes a preferred generated-PDF line break. Dictionary data remains caller-owned, so applications can ship only the languages they use.

Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 2

Constructors

public PdfHyphenationLexicon(IEnumerable<string> hyphenatedWords, char breakMarker = '-', int minimumPrefixLength = 2, int minimumSuffixLength = 2) #

Creates a case-insensitive hyphenation dictionary from marked words.

Parameters

hyphenatedWords System.Collections.Generic.IEnumerable<string> required
Words containing one or more explicit break markers.
breakMarker char = '-' optional
Marker removed from entries and converted into a break position.
minimumPrefixLength int = 2 optional
Minimum UTF-16 word length retained before a break.
minimumSuffixLength int = 2 optional
Minimum UTF-16 word length retained after a break.

Methods

public PdfTextHyphenationCallback AsCallback() #

Creates the callback shape consumed by PdfCreateOptions.SetTextHyphenation.

public bool Contains(string token) #

Returns true when the normalized word is present.

Parameters

token string required

Returns

bool
public IReadOnlyList<int> GetBreakpoints(string token) #

Returns preferred UTF-16 break positions for a word, or an empty list when it is not present.

Parameters

token string required

Returns

IReadOnlyList<int>

Properties

public char BreakMarker { get; } #

Marker used by the source dictionary.

public int MinimumPrefixLength { get; } #

Minimum UTF-16 length retained before each returned break.

public int MinimumSuffixLength { get; } #

Minimum UTF-16 length retained after each returned break.

public int Count { get; } #

Number of normalized words in the dictionary.