Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.dom.PageBreak class

Package: mlreportgen.dom
Superclasses:

Create page break object

Description

Creates a page break object that you can insert in a Microsoft® Word or PDF report. Use PageBreak to insert a page break anywhere in a report.

Tip

Use the PageBreakBefore format to force a page break before a specific paragraph. For example, use PageBreakBefore to force chapters to start on a new page.

Construction

break = PageBreak() creates a page break object.

Output Arguments

expand all

Page break, returned as an mlreportgen.dom.PageBreak object.

Properties

expand all

This read-only property lists child elements of this object.

Custom attributes of this element, specified as an array of mlreportgen.dom.CustomAttribute objects. Use custom attributes supported by the output format.

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.

This read-only property lists the parent of this document element.

Format objects that specify the format of a document element.

Name of the style to apply from the style sheet, specified as a character vector.

Tag for document element, specified as a character vector.

A session-unique ID is generated as part of document element creation. The generated tag has the form CLASS:ID, where CLASS is the class of the element and ID is the value of the Id property of the object. You can specify a tag to replace the generated tag.

For example, to make it easier to identify where an issue occurred during document generation, you can specify your own tag value.

Methods

Method

Purpose

clone

Copy this object.

Examples

expand all

This example shows how to force a page break by inserting a PageBreak object into a PDF report.

import mlreportgen.dom.*;
d = Document('mydoc','pdf');
open(d);

% Create first page
h = Heading1('My First Head');
p = Paragraph('Here are some paragraphs.');
append(d,h);
append(d,p);
append(d,clone(p));
append(d,clone(p));
append(d,clone(p));
append(d,clone(p));
append(d,clone(p));

% Create and append the page break object
br = PageBreak();
append(d,br);

% Create paragraphs that appear on the page after the break
p2 = Paragraph('Here are some paragraphs after the forced page break.');
append(d,p2);
append(d,clone(p2));
append(d,clone(p2));
append(d,clone(p2));
append(d,clone(p2));

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

Introduced in R2016a

Was this topic helpful?