Contenu principal

mlreportgen.dom.OuterMargin Class

Namespace: mlreportgen.dom

Margin between bounding box and the adjacent document element objects

Description

Specifies the margin between the bounding box of an object and adjacent document objects. The bounding box of an object includes the inner margin and object content. If the object has a border, the box also includes the border.

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

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

For information on class attributes, see Class Attributes.

Creation

Description

marginObj = mlreportgen.dom.OuterMargin creates an unspecified margin between the bounding box of an object and the adjacent document element objects.

marginObj = mlreportgen.dom.OuterMargin(all) creates the specified margin on all sides between the bounding box of an object and the adjacent document element objects.

marginObj = mlreportgen.dom.OuterMargin(left,right) creates the specified margins between the left and right sides of the bounding box of an object and the adjacent document element objects.

marginObj = mlreportgen.dom.OuterMargin(left,right,top,bottom) creates the specified margins between the sides of the bounding box of an object and the adjacent document element objects.

example

Input Arguments

expand all

Margin on all the sides between the bounding box of the object and the adjacent document element objects, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. For example, "10px" specifies 10 pixels. 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.

Size of the left margin between the bounding box of the object and the adjacent document element objects. See the all input argument for a list of valid values.

Size of the right margin between the bounding box of the object and the adjacent document element objects. See the all input argument for a list of valid values.

Size of the top margin between the bounding box of the object and the adjacent document element objects. See the all argument for description of valid values.

Note

Word reports ignore the Top margin setting of a table.

Size of the bottom margin between the bounding box of the object and the adjacent document element objects. See the all argument for description of valid values.

Note

Word reports ignore the Bottom margin setting of a table.

Properties

expand all

Size of the left margin, 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.

Example: "0.5in"

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Size of the right margin, 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.

Example: "0.5in"

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Size of the top margin, 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.

Note

Tables in Word reports ignore the Top 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.

Example: "0.5in"

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Size of the bottom margin, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement For example, "10px" specifies 10 pixels. 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.

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.

Example: "0.5in"

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

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