mlreportgen.dom.DOCXPageMargins class

Package: mlreportgen.dom
Superclasses:

Page margins for Microsoft Word page layout

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

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

  • px — pixels

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

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

ID for this document element, specified as a character vector. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

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 document element, specified as a character vector.

A session-unique ID is generated as part of document element creation. The generated tag has the form CLASS:ID, where CLASS is the class of the element and ID is the value of the Id property of the object. You can specify a tag to replace the generated tag.

For example, to make it easier to identify where an issue occurred during document generation, you can specify your own tag value.

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.CurrentDOCXSection;
s.PageMargins.Left  = '.5in';
s.PageMargins.Right = '.5in';
append(d,'Left and right margins are .5 inch');

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