Hauptinhalt

mlreportgen.dom.DOCXPageMargins Class

Namespace: mlreportgen.dom
Superclasses: mlreportgen.dom.PageMargins

(To be removed) Page margins for Microsoft Word page layout

Compatibility

Note

mlreportgen.dom.DOCXPageMargins will be removed in a future release. Use mlreportgen.dom.PageMargins instead.

Description

Specifies the size of the page margins of a section of a Microsoft® Word document.

This class is only compatible with this MATLAB® Report Generator™ output type: "docx".

Construction

docxPageMarginsObj = DOCXPageMargins specifies default page margins, which are one inch for the top, bottom, left, and right margins, and one-half inch for the gutter, header, and footer margins.

Output Arguments

expand all

Page margins, represented by an DOCXPageMargins object.

Properties

expand all

Header size, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "1in" specifies 1 inch. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Footer size, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "1in" specifies 1 inch. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Gutter size, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "1in" specifies 1 inch. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Left margin size, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "1in" specifies 1 inch. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Right margin size, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "1in" specifies 1 inch. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Top margin size, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "1in" specifies 1 inch. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Bottom margin size, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "1in" specifies 1 inch. Valid abbreviations are:

  • "px" — Pixels

  • "cm" — Centimeters

  • "in" — Inches

  • "mm" — Millimeters

  • "pc" — Picas

  • "pt" — Points

You can also specify pixels by omitting the unit. For example, "5" specifies 5 pixels.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

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

Reset the margins specified by the default DOM template.

import mlreportgen.dom.*;
d = Document("myreport","docx");
open(d);
 
s = d.CurrentPageLayout;
s.PageMargins.Left  = ".5in";
s.PageMargins.Right = ".5in";
append(d,"Left and right margins are .5 inch");

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