suppress_auto_hyphens property
ParagraphFormat.suppress_auto_hyphens property
Specifies whether the current paragraph should be exempted from any hyphenation which is applied in the document settings.
@property
def suppress_auto_hyphens(self) -> bool:
...
@suppress_auto_hyphens.setter
def suppress_auto_hyphens(self, value: bool):
...
Examples
Shows how to suppress hyphenation for a paragraph.
aw.Hyphenation.register_dictionary(language='de-CH', file_name=MY_DIR + 'hyph_de_CH.dic')
self.assertTrue(aw.Hyphenation.is_dictionary_registered('de-CH'))
# Open a document containing text with a locale matching that of our dictionary.
# When we save this document to a fixed page save format, its text will have hyphenation.
doc = aw.Document(file_name=MY_DIR + 'German text.docx')
# We can set the "SuppressAutoHyphens" property to "true" to disable hyphenation
# for a specific paragraph while keeping it enabled for the rest of the document.
# The default value for this property is "false",
# which means every paragraph by default uses hyphenation if any is available.
doc.first_section.body.first_paragraph.paragraph_format.suppress_auto_hyphens = suppress_auto_hyphens
doc.save(file_name=ARTIFACTS_DIR + 'ParagraphFormat.SuppressHyphens.pdf')
See Also
- module aspose.words
- class ParagraphFormat