Skip to content

PdfHyphenationPatterns class

View as Markdown

Namespace: PdfNetStack.Hyphenation
Assembly: PdfNetStack.Hyphenation.dll
Package: PdfNetStack.Hyphenation

Ready PdfHyphenators for many languages, from TeX’s hyph-utf8 patterns under permissive licenses, with the minimum letters before and after a hyphen each source gives. A language loads on first use and stays loaded; the hyphenators are shared and thread safe.

public static class PdfHyphenationPatterns

Inheritance

object ← PdfHyphenationPatterns

var p = new PdfParagraph { Alignment = PdfTextAlignment.Justify, Hyphenator = PdfHyphenationPatterns.ForLanguage("de") };
var options = new HtmlConverterOptions { Hyphenators = PdfHyphenationPatterns.ForLanguage };

The tags of the available pattern sets, such as de, en-gb and el-polyton, in order.

public static IReadOnlyList<string> Languages { get; }

IReadOnlyList<string>

The hyphenator for a language tag, or null when there is none. Case and region do not matter beyond spelling: de-AT and de_CH find German, en and en-CA American English, en-GB and en-AU British. German in the 1901 spelling, such as de-1901, finds nothing: its breaks differ and its patterns are not included.

public static PdfHyphenator? ForLanguage(string language)

language string

A language tag such as fr or pt-BR.

PdfHyphenator?