HyphenationOptionsConsecutiveHyphenLimit Property |
Namespace: Aspose.Words.Settings
If value of this property is set to 0, any number of consecutive lines can end with hyphens.
The property does not have effect when saving to fixed page formats e.g. PDF.
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Set this to insert a page break before this paragraph builder.Font.Size = 24; builder.ParagraphFormat.SuppressAutoHyphens = false; builder.Writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, " + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); doc.HyphenationOptions.AutoHyphenation = true; doc.HyphenationOptions.ConsecutiveHyphenLimit = 2; doc.HyphenationOptions.HyphenationZone = 720; // 0.5 inch doc.HyphenationOptions.HyphenateCaps = true; // Each paragraph has this flag that can be set to suppress hyphenation Assert.False(builder.ParagraphFormat.SuppressAutoHyphens); doc.Save(ArtifactsDir + "Document.HyphenationOptions.docx");