HyphenationOptions Class
Allows to configure document hyphenation options.
Inheritance Hierarchy
SystemObject
  Aspose.Words.SettingsHyphenationOptions

Namespace: Aspose.Words.Settings
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.12
Syntax
public class HyphenationOptions

The HyphenationOptions type exposes the following members.

Constructors
  NameDescription
Public methodHyphenationOptions
Initializes a new instance of the HyphenationOptions class
Properties
  NameDescription
Public propertyCode exampleAutoHyphenation
Gets or sets value determining whether automatic hyphenation is turned on for the document. Default value for this property is false.
Public propertyCode exampleConsecutiveHyphenLimit
Gets or sets the maximum number of consecutive lines that can end with hyphens. Default value for this property is 0.
Public propertyCode exampleHyphenateCaps
Gets or sets value determining whether words written in all capital letters are hyphenated. Default value for this property is true.
Public propertyCode exampleHyphenationZone
Gets or sets the distance in 1/20 of a point from the right margin within which you do not want to hyphenate words. Default value for this property is 360 (0.25 inch).
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
Shows how to configure document hyphenation options.
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 + "HyphenationOptions.docx");
See Also