Main Content

mlreportgen.dom.DOCXPageLayout class

Package: mlreportgen.dom
Superclasses:

Page format and layout for Microsoft Word document section

Description

Use an mlreportgen.dom.DOCXPageLayout object to define the page format, headers, and footers of a Word document section.

Construction

PageLayoutObj = DOCXPageLayout() creates an empty document page layout object.

Output Arguments

expand all

Page format and layout for Word document section, returned as an mlreportgen.dom.DOCXPageLayout object.

Properties

expand all

Children of this document element, specified as an array of DOM objects. This property is read-only.

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

Number of the first page in a section, specified as an integer.

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.

You can define up to three page footers for a layout, one each for:

  • The first page of the section

  • Even pages

  • Odd pages

You can define up to three page headers for a layout, one each for:

  • The first page of the section

  • Even pages

  • Odd pages

Margin sizes for this layout, specified as an mlreportgen.dom.PageMargins object.

Type of page numbering to use, specified as one of these values.

ValueMeaningApplies To
DOCXPDF
'a'Lowercase alphabetic
'A'Uppercase alphabetic
'i'Lowercase Roman numerals
'I'Uppercase Roman numerals
'n'. 'N', '1', 'decimal'Arabic numerals
'numberInDash'Number with dashes on either side 
'hebrew1'Hebrew numerals 
'hebrew2'Hebrew alphabetic 
'arabicAlpha'Arabic alphabetic 
'arabicAbjad'Arabic abjad numerals 
'thaiLetters'Thai letters 
'thaiNumbers'Thai numerals  
'thaiCounting'Thai counting system 

Size and orientation of pages in this layout, specified as an mlreportgen.dom.PageSize object.

Parent of this document element, specified as a DOM object. This property is read-only.

XML markup for unsupported section formats, specified as a cell array of character vectors. For information about XML markup for Word formats, see https://www.ecma-international.org/publications/standards/Ecma-376.htm.

Option to create a section break for this layout, specified as one of these values:

  • 'Next Page' — Start the section on the next page.

  • 'Same Page' — Start the section on the same page as the current section.

  • 'Odd Page' — Start the section on an odd page.

  • 'Even Page' — Start the section on an even page.

Formats to apply to this layout, specified as an array of format objects. The formats you specify using this property override the same formats defined by the style applied with the StyleName property. Formats that do not apply to a page layout are ignored.

This property does not apply to page layouts.

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.

Examples

collapse all

Create a Word report using the default template. Open the document and assign the document’s CurrentPageLayout property to a variable. Change the left and right margins for this layout.

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

open(d);
s = d.CurrentPageLayout;
s.PageMargins.Left = '2in';
s.PageMargins.Right = '2in';
p = Paragraph('Hello World');
append(d,p);

close(d);
rptview(d.OutputPath);
Introduced in R2016a