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.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

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

The output format must support the custom attributes of this document element.

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

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.

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.

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

XML markup for unsupported section formats, specified as a cell array of character vectors. For information about XML markup for Word formats, see http://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 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.

Examples

expand 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

Was this topic helpful?