This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mlreportgen.dom.DOCXPageSize class

Package: mlreportgen.dom
Superclasses:

Size and orientation of pages in Microsoft Word document

Note

mlreportgen.dom.DOCXPageSize will be removed in a future release. Use mlreportgen.dom.PageSize instead.

Description

Specifies the height, width, and orientation of pages in a section of a Microsoft® Word document.

Construction

docxPageSizeObj = DOCXPageSize() creates a page size object having default values of 8.5-by-11 inches and portrait orientation.

docxPageSizeObj = DOCXPageSize(height,width) creates a portrait page having a specified height and width.

docxPageSizeObj = DOCXPageSize(height,width,orientation) creates a page having a specified height, width, and orientation.

Input Arguments

expand all

character vector specifying the height of the page. The character vector must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed. Valid abbreviations are:

  • no abbreviation — pixels

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

  • px — pixels

The character vector must have the format valueUnits, where Units is an abbreviation for the units in which the width size is expressed. Valid abbreviations are:

  • no abbreviation — pixels

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

  • px — pixels

Use one of these values:

  • 'portrait' (default)

  • 'landscape'

Specify height and width values that reflect the orientation setting. For example, if the orientation is landscape and the document is to be printed on 8.5x11-inch paper, set height to '8.5in' and width to '11in'.

Output Arguments

expand all

Page size and orientation of a Word document, represented by an mlreportgen.dom.DOCXPageSize object.

Properties

expand all

character vector specifying the page height. The character vector must have the format valueUnits where Units is an abbreviation for the units in which the width size is expressed. Valid abbreviations are:

  • no abbreviation — pixels

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

  • px — pixels

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.

Use one of these values:

  • 'portrait' (default)

  • 'landscape'

Specify height and width values that reflect the orientation setting. For example, if the orientation is landscape and the document is to be printed on 8.5x11-inch paper, set height to '8.5in' and width to '11in'.

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.

The character vector must have the format valueUnits, where Units is an abbreviation for the units in which the width size is expressed. Valid abbreviations are:

  • no abbreviation — pixels

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

  • px — pixels

Examples

collapse all

Change the page orientation and size specified by the default DOM template.

import mlreportgen.dom.*;
d = Document('myreport','docx');
open(d);
 
s = d.CurrentDOCXSection;
s.PageSize.Orientation  ='landscape';
s.PageSize.Height = '8.5in';
s.PageSize.Width = '11in';
append(d,'This document has landscape pages');

close(d);
rptview('myreport','docx');