Contenuto principale

mlreportgen.ppt.InnerMargin Class

Namespace: mlreportgen.ppt

Margin between content and bounding box

Since R2026a

Description

Use objects of the mlreportgen.ppt.InnerMargin class to specify the margin between the content and the bounding box of a presentation object. 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.ppt.InnerMargin class is a handle class.

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

For information on class attributes, see Class Attributes.

Creation

Description

marginObj = mlreportgen.ppt.InnerMargin creates an InnerMargin object with margin values set to [].

marginObj = mlreportgen.ppt.InnerMargin(all) creates an inner margin with the specified size for all the sides between the object and its bounding box.

example

marginObj = mlreportgen.ppt.InnerMargin(left,right) creates an inner margin that has the specified sizes between the left and right sides of the object and its bounding box.

marginObj = mlreportgen.ppt.InnerMargin(left,right,top,bottom) creates an inner margin that has the specified sizes between the sides of an object and its bounding box.

Input Arguments

expand all

Margin on all the sides between the object and its bounding box, 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 object and its bounding box. See the all input argument for a list of valid values.

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

Size of the top margin between the object and its bounding box. See the all input argument for a list of valid values.

Size of the bottom margin between the object and its bounding box. See the all input argument for a list of valid values.

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.

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, "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

Tag, specified as a character vector or string scalar. The PPT 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 presentation generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Object identifier, specified as a character vector or string scalar. The PPT API generates a session-unique identifier when it creates the presentation element object. You can specify your own value for Id.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Examples

collapse all

This example shows how to specify inner margins for table entries. You can specify the inner margins for the entire table, specified table rows, or specified table entries.

Import the PPT API namespace so that you do not have to use long, fully qualified names.

import mlreportgen.ppt.*

Create a presentation.

ppt = Presentation("myInnerMargins.pptx");
open(ppt);

Add a slide to the presentation.

slide = add(ppt,"Title and Table");

Create a table and specify the inner margins for all the table entries in the table.

t = Table(magic(3));
t.TableEntriesInnerMargin = "0.1in";

Specify the inner margins for the first row entries. This setting overrides the inner margin specified in the Table object.

row = t.row(1);
row.Style = [row.Style {InnerMargin("0.3in")}];

Specify the inner margins for the entries in the first table row. These settings override the inner margin specified in the TableRow object and the Table object.

te = t.entry(1,1);
te.InnerMargin = "0in";

Add a title and a table to the slide.

replace(slide,"Title","Table entries with custom inner margins");
replace(slide,"Table",t);

Close and view the presentation.

close(ppt);
rptview(ppt);

This image shows the generated PPT.

Slide with the title "Table entries with custom inner margins" and a three by three table below it. The upper left entry has an inner margin or 0". The remainder of the first row has inner margins of 0.3". The second and third rows have inner margins of 0.1".

Version History

Introduced in R2026a