Main Content

mlreportgen.dom.DOCXPageSize Class

Namespace: mlreportgen.dom
Superclasses: mlreportgen.dom.PageSize

(To be removed) Size and orientation of pages in Microsoft Word document

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.

The mlreportgen.dom.DOCXPageSize class is a handle class.

Creation

Description

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

example

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

  • px — pixels

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

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

  • px — pixels

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

  • -

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

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

  • px — pixels

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

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

  • px — pixels

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

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 the mlreportgen.dom.DOCXPageSize object, specified as a character vector or string scalar. The DOM API 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. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

Object identifier for the mlreportgen.dom.DOCXPageSize object, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

NonCopyable
true

Data Types: char | string

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.CurrentPageLayout;
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");

Version History

Introduced in R2014b