static void Example3() { // Load Word document from file's path. var document = DocumentModel.Load("AutoHyphenationML.docx"); // Enable auto hyphenation. document.HyphenationOptions.AutoHyphenation = true; // Load hyphenation dictionaries on demand and set them for specified languages. DocumentModel.HyphenationDictionaries.HyphenationDictionaryLoading += (sender, e) => { switch (e.CultureInfo.Name) { case "en-GB": e.HyphenationDictionary = TexHyphenationDictionary.Load("hyph-en-gb.tex"); break; case "de-DE": e.HyphenationDictionary = TexHyphenationDictionary.Load("hyph-de-1901.tex"); break; case "es-ES": e.HyphenationDictionary = TexHyphenationDictionary.Load("hyph-es.tex"); break; } }; // Save output file. document.Save("Output3.pdf"); }
static void Example2() { // Load Word document from file's path. var document = DocumentModel.Load("AutoHyphenation.docx"); // Enable auto hyphenation. document.HyphenationOptions.AutoHyphenation = true; // Load hyphenation dictionary from file's path. var hyphenationDictionary = TexHyphenationDictionary.Load("hyph-en-gb.tex"); // Set loaded hyphenation dictionary for specified language. DocumentModel.HyphenationDictionaries[new CultureInfo("en-GB")] = hyphenationDictionary; // Save output file. document.Save("Output2.pdf"); }