Main Content

mlreportgen.dom.Hyphenation Class

Namespace: mlreportgen.dom

Enable hyphenation

Description

Use an object of the mlreportgen.dom.Hyphenation class to specify the hyphenation behavior for paragraphs and table cells. A Hyphenation object affects only a PDF report.

By default, hyphenation is disabled for paragraphs and table cells. When hyphenation is disabled, where possible, a line break occurs between words. When necessary to prevent overflow, a line break may occur anywhere in a word.

When hyphenation is enabled, a line break occurs at the end of a syllable and a hyphenation character is inserted. If a table cell contains a long sequence of numbers or letters that have no clear syllable breaks, overflow can occur. The table stretches to accommodate the overflow.

The mlreportgen.dom.Hyphenation class is a handle class.

Class Attributes

ConstructOnLoad
true
HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

h = mlreportgen.dom.Hyphenation enables hyphenation and sets the Value property to '-'.

example

h = mlreportgen.dom.Hyphenation(type) specifies whether to hyphenate and the hyphenation character to use.

Input Arguments

expand all

Type of hyphenation, specified as one of these values:

  • true — Enables hyphenation and sets the Value property to '-'.

  • '-' — Enables hyphenation and sets the Value property to '-'.

  • ' ' — Enables hyphenation and sets the Value property to a space (' ').

  • false — Disables hyphenation and sets the Value property to [].

Properties

expand all

Object identifier for mlreportgen.dom.Hyphenation object, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

NonCopyable
true

Data Types: char | string

Tag for mlreportgen.dom.Hyphenation object, specified as a character vector or string scalar. The DOM API generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

Hyphenation character, specified as one of these values:

  • true — Enables hyphenation and uses a hyphen (-) for the hyphenation character.

  • '-' — Enables hyphenation and uses a hyphen (-) for the hyphenation character.

  • ' ' — Enables hyphenation and uses a space for the hyphenation character.

  • false — Disables hyphenation.

  • [] — Disables hyphenation.

Examples

collapse all

To enable hyphenation in a PDF table, add a Hyphenation object to the TableEntriesStyle property of the mlreportgen.dom.Table object. Use the default hyphenation character, '-'.

import mlreportgen.dom.*

d = Document('myreport','pdf');

open(d);

data = '/mylongpath/hyphenation/example/myveryveryveryverylongpathname.doc';
table = Table({data});
table.Width = '2in'; 
table.TableEntriesStyle = {Hyphenation(true)};
append(d,table);

close(d);
rptview(d);

Version History

Introduced in R2016b

expand all