Contenuto principale

mlreportgen.ppt.OuterMargin Class

Namespace: mlreportgen.ppt

Outer margin between bounding box and adjacent presentation objects

Since R2026a

Description

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

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

For information on class attributes, see Class Attributes.

Creation

Description

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

marginObj = mlreportgen.ppt.OuterMargin(all) creates an outer margin that has the specified size.

example

marginObj = mlreportgen.ppt.OuterMargin(top,bottom) creates an outer margin that has the specified sizes between the top and bottom sides of the object and its bounding box and the adjacent presentation objects.

Input Arguments

expand all

Outer margin on all sides between the bounding box of the object and adjacent presentation 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 top margin between the bounding box of the object and the adjacent presentation element objects, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. See the all input argument for a list of valid values.

Size of the bottom margin between the bounding box of the object and the adjacent presentation element objects, specified as a character vector or string scalar that contains a number followed by an abbreviation for a unit of measurement. See the all input argument for a list of valid values.

Properties

expand all

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

This example shows how to add outer margins to paragraphs in a presentation.

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("myOuterMargins.pptx");
open(ppt);

Add a "Title and Content" type slide to the presentation.

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

Create multiple paragraphs and set the outer margin of the second paragraph to "0.5in".

p1 = Paragraph("First Line - default outer margin");
p2 = Paragraph("Second Line - 0.5 in outer margin");
p3 = Paragraph("Third Line - default outer margin");
p4 = Paragraph("Fourth Line - default outer margin");
p2.Style = {OuterMargin("0.5in")}; 

Add a title and the paragraphs to the slide.

replace(slide,"Title","Outer Margin Example");
replace(slide,"Content",{p1 p2 p3 p4});

Close and view the presentation.

close(ppt);
rptview(ppt);

This image shows the generated PPT.

Slide with the title "Outer Margin Example" and 4 bullet points. The second bullet has an 0.5 in margin above and below it.

Version History

Introduced in R2026a