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

character vector specifying the width of the bottom margin. 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

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

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

Object identifier for mlreportgen.dom.DOCXPageMargins 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

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 for mlreportgen.dom.DOCXPageMargins 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

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

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