mlreportgen.dom.LineBreak class
Package: mlreportgen.dom
Line break in a Word or PDF report
Description
Use an object of mlreportgen.dom.LineBreak
to insert a line break
anywhere in a Microsoft® Word or PDF report.
The mlreportgen.dom.LineBreak
class is a handle
class.
Class Attributes
HandleCompatible | true |
ConstructOnLoad | true |
For information on class attributes, see Class Attributes.
Creation
Description
creates a line break object.lBreak
= mlreportgen.dom.LineBreak()
Properties
Children
— Children of this DOM API object
array of DOM API objects
Children of this DOM API object, specified as an array of DOM API objects.
Attributes:
GetAccess | public |
SetAccess | private |
NonCopyable | true |
CustomAttributes
— Custom attributes of this element
array of mlreportgen.dom.CustomAttribute
objects
Custom attributes of this element, specified as an array of
mlreportgen.dom.CustomAttribute
objects. Use custom attributes
supported by the output format.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Id
— ID for this DOM API object
character vector | string scalar
ID for this DOM API object, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Parent
— Parent of this DOM API object
DOM API object
Parent of this DOM API object, specified as a DOM API object.
Attributes:
GetAccess | public |
SetAccess | private |
NonCopyable | true |
Style
— Text formatting
array of format objects
Format objects that specify the format of a document element.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
StyleName
— Style to apply from style sheet
character vector | string scalar
Name of the style to apply from the style sheet, specified as a character vector or string scalar.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Tag
— Tag for this DOM API object
character vector | string scalar
Tag for this DOM API object, specified as a character vector or string scalar.
The DOM 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. Specifying your own tag value can
help you to identify where an issue occurred during document generation.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Methods
Examples
Insert a Line Break
This example shows how to insert a line break in a PDF report by using a LineBreak
object.
Import the DOM API package so you do not have to use long, fully qualified names.
import mlreportgen.dom.*;
Create a Document
object and open it.
d = Document("LineBreakReport","pdf"); open(d);
Create the first page and add a heading to the object. Create a Paragraph
object p
.
h = Heading1("Learning to Use Line Breaks"); append(d,h); p = Paragraph("Use a LineBreak object");
Specify preserve
for the WhiteSpace
method for the Paragraph
object to add a line break to it. Append the LineBreak handle class to the paragraph.
p.WhiteSpace = 'preserve';
append(p,LineBreak);
Insert the next line by appending it to the existing Paragraph
object. Append the paragraph to the Document
.
append(p,"to force a new line in a paragraph");
append(d,p);
Close and view the document.
close(d); rptview(d);
Version History
Introduced in R2016b
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)