mlreportgen.dom.PageBreakBefore class
Package: mlreportgen.dom
Start paragraph on new page
Description
Specifies to always start the associated paragraph on a new page. This class applies to Microsoft® Word and PDF reports.
The mlreportgen.dom.PageBreakBefore
class is a handle
class.
Creation
Description
Input Arguments
onOff
— Option to start paragraph on new page
true
(default) | false
Option to start paragraph on new page, specified as one of these values:
true
or1
— Starts a paragraph on a new page.false
or0
— Allows a paragraph to start on the current page.
Data Types: logical
Properties
Id
— ID for this document element
character vector | string scalar
ID for this document element, 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 |
Data Types: char
| string
Tag
— Tag for this document element
character vector | string scalar
Tag for this document element, 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 |
Data Types: char
| string
Value
— Option to start paragraph on new page
true
(default) | false
Option to start paragraph on new page, specified as one of these values:
true
or1
— Starts a paragraph on a new page.false
or0
— Allows a paragraph to start on the current page.
Data Types: logical
Examples
Create a Page Break Before a Heading
This example shows how to apply the PageBreakBefore
property to a heading paragraph. The example uses two approaches for applying properties. The first creates a PageBreakBefore
object whose value is explicitly true. You can then assign that format object to the heading’s Style
property. The second approach sets the property on the heading object without explicitly creating a PageBreakBefore
object.
import mlreportgen.dom.*; d = Document('mydoc','docx'); open(d); % Create first page text t = Heading(1,'Document Title','Title'); h = Heading(2,'My Head','Heading1'); p = Paragraph('Hello World'); append(d,t); append(d,h); append(d,p); % Create a heading paragraph h1 % Create a PageBreakBefore object and set it as a Style property on h1 h1 = Heading(2,'My Second Head','Heading1'); br = {PageBreakBefore(true)}; h1.Style = br; p1 = Paragraph('Another page'); % Create a heading paragraph h2 % Set the h2 Style property to use PageBreakBefore set to true h2 = Heading(2,'My Third Head','Heading1'); h2.Style = {PageBreakBefore()}; p2 = Paragraph('My third page'); append(d,h1); append(d,p1); append(d,h2); append(d,p2); close(d); rptview(d.OutputPath);
Version History
Introduced in R2014b
Ouvrir l'exemple
Vous possédez une version modifiée de cet exemple. Souhaitez-vous ouvrir cet exemple avec vos modifications ?
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)