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

Height of the page, specified as character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "11in" specifies eleven inches. Valid abbreviations are:

  • no abbreviation — Pixels

  • px — Pixels

  • cm — Centimeters

  • in — Inches

  • mm — Millimeters

  • pc — Picas

  • pt — Points

Example: "11in"

Width of the page, specified as character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "8.5in" specifies 8.5 inches. Valid abbreviations are:

  • no abbreviation — Pixels

  • px — Pixels

  • cm — Centimeters

  • in — Inches

  • mm — Millimeters

  • pc — Picas

  • pt — Points

Example: "8.5in"

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

Height of the page, specified as character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "11in" specifies eleven inches. Valid abbreviations are:

  • no abbreviation — Pixels

  • px — Pixels

  • cm — Centimeters

  • in — Inches

  • mm — Millimeters

  • pc — Picas

  • pt — Points

Example: "11in"

Width of the page, specified as character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "8.5in" specifies 8.5 inches. Valid abbreviations are:

  • no abbreviation — Pixels

  • px — Pixels

  • cm — Centimeters

  • in — Inches

  • mm — Millimeters

  • pc — Picas

  • pt — Points

Example: "8.5in"

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, 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. Use this value to help identify where an issue occurs during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Object identifier, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object.

Attributes:

GetAccess
public
SetAccess
public
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