mlreportgen.dom.Hyphenation class

Package: mlreportgen.dom
Superclasses:

Enable hyphenation

Description

Specifies whether to hyphenate text and, optionally, the hyphenation character to use.

Construction

h = Hyphenation(type) specifies whether to hyphenate or the hyphenation character to use.

Input Arguments

expand all

Type of hyphenation, specified as:

  • Boolean for on or off, using a hyphen as the hyphenation character

  • A hyphenation character in the form of a character vector, for example, '-' for hyphen or ' ' for space

Properties

expand all

ID for this document element, specified as a character vector. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Tag for the document element, specified as a character vector.

The DOM generates a session-unique tag when it creates the document element. Structure the tag as class:id, where class is the class of the element and id is the value of the Id property. You can specify a tag to replace the generated tag. Specifying your own tag can make it easier to identify where an issue occurred during document generation.

Type of hyphenation, specified as:

  • Boolean for on or off using a hyphen as the hyphenation character

  • A hyphenation character in the form of a character vector, for example, '-' for hyphen or ' ' for space

Examples

collapse all

Set the Hyphenation property on the page layout to enable hyphenation in a PDF page layout.

import mlreportgen.dom.*

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

open(d);
playout = d.CurrentPageLayout; 
playout.Hyphenation = true; 

data = '/mylongpath/hyphenation/example/myveryveryveryverylongpathname.doc';
table = Table({data});
table.Width = '2in'; 
table.entry(1,1).Hyphenation = ' ';

append(d,table);

close(d);
rptview(d.OutputPath);