HyphenationOptions class
HyphenationOptions class
Allows to configure document hyphenation options. To learn more, visit the Working with Hyphenation documentation article.
Constructors
Name | Description |
---|---|
HyphenationOptions() | The default constructor. |
Properties
Name | Description |
---|---|
auto_hyphenation | Gets or sets value determining whether automatic hyphenation is turned on for the document. Default value for this property is False . |
consecutive_hyphen_limit | Gets or sets the maximum number of consecutive lines that can end with hyphens. Default value for this property is 0. |
hyphenate_caps | Gets or sets value determining whether words written in all capital letters are hyphenated. Default value for this property is True . |
hyphenation_zone | 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). |
Examples
Shows how to configure automatic hyphenation.
doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
builder.font.size = 24
builder.writeln('Lorem ipsum dolor sit amet, consectetur adipiscing elit, ' + 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')
doc.hyphenation_options.auto_hyphenation = True
doc.hyphenation_options.consecutive_hyphen_limit = 2
doc.hyphenation_options.hyphenation_zone = 720
doc.hyphenation_options.hyphenate_caps = True
doc.save(file_name=ARTIFACTS_DIR + 'Document.HyphenationOptions.docx')
See Also
- module aspose.words.settings