Main Content

mlreportgen.dom.DOCXPageMargins Class

Namespace: mlreportgen.dom
Superclasses:

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.

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

Bottom margin width, specified as character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "3pt" specifies three points. Valid abbreviations are:

  • no abbreviation — Pixels

  • px — Pixels

  • cm — Centimeters

  • in — Inches

  • mm — Millimeters

  • pc — Picas

  • pt — Points

Example: "3pt" specifies three points.

Specify the size using the same format used for the Bottom property.

Specify the size using the same format used for the Bottom property.

Specify the size using the same format used for the Bottom property.

Specify the size using the same format used for the Bottom property.

Specify the size using the same format used for the Bottom property.

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