Main Content

mlreportgen.dom.OuterMargin class

Package: mlreportgen.dom

Margin between bounding box and its surroundings

Description

Specifies the margin between the bounding box of an object and adjacent document objects. A bounding box of an object includes the border of the object (if it has a border), the inner margin, and the object content.

The mlreportgen.dom.OuterMargin class is a handle class.

Creation

Description

marginObj = OuterMargin() creates an unspecified margin between the bounding box of an object and its surroundings.

marginObj = OuterMargin(all) creates the specified margin on all sides between the bounding box of an object and its surroundings.

marginObj = OuterMargin(left,right) creates the specified margins between the left and right sides of the bounding box of an object and its surroundings.

example

marginObj = OuterMargin(left,right,top,bottom) creates the specified margins between sides of the bounding box of an object and its surroundings.

Input Arguments

expand all

Margin on all sides between the bounding box of an object and its surroundings in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Left margin between the bounding box of an object and its surroundings. See the all argument for description of valid values.

Right margin between the bounding box of an object and its surroundings. See the all argument for description of valid values.

Top margin between the bounding box of an object and its surroundings. See the all argument for description of valid values. Word reports ignore the Top margin setting of a table.

Bottom margin between the bounding box of an object and its surroundings. See the all argument for description of valid values. Word reports ignore the Bottom margin setting of a table.

Properties

expand all

Bottom margin in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • +

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Note

Tables in Word reports ignore the Bottom property. To control the spacing between a table and the succeeding content, insert an invisible table or paragraph below the table. For example, to create two successive tables 1 inch apart, insert an invisible 1-inch high table. Alternatively, insert an empty paragraph with a setting for line height setting of 0 and a setting for spacing before of 1 inch.

Left margin size. See the Bottom property for description of valid values.

Right margin size. See the Bottom property for description of valid values.

Top margin size. See the Bottom property for description of valid values.

Note

Tables in Word reports ignore the Top property. To control the spacing between a table and the preceding content, insert an invisible table or paragraph above the table. For example, to create two successive tables 1 inch apart, insert an invisible 1-inch high table. Alternatively, insert an empty paragraph with a setting for line height setting of 0 and a setting for spacing before of 1 inch.

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

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Tag for this document element, specified as a character vector or string scalar.

The DOM 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. Specifying your own tag value can help you to identify where an issue occurred during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Examples

collapse all

import mlreportgen.dom.*;
doctype = 'html';
d = Document('test',doctype);

p = Paragraph('Hello World');
p.Style = {Border('solid','Red'), ...
   HAlign('center'),...
   OuterMargin('0pt','0pt','0pt','24pt')};
append(d,p);

p = Paragraph('Greetings from MATLAB');
p.Style = {Border('solid','green'), ...
   HAlign('center')};
append(d,p);

p = Paragraph('End of report');
p.Style = {Border('solid','blue'),...
   HAlign('center'),...
   OuterMargin('0pt','0pt','0pt','12pt')};
append(d,p);

close(d);
rptview('test',doctype);

Version History

Introduced in R2014b