Main Content

mlreportgen.ppt.HAlign Class

Namespace: mlreportgen.ppt

Horizontal alignment of paragraph

Description

Specify the horizontal alignment of a paragraph.

The mlreportgen.ppt.HAlign class is a handle class.

Creation

Description

alignObj = HAlign creates a horizontal alignment object having the value 'left'.

example

alignObj = HAlign(value) creates a horizontal alignment object having the specified value.

Input Arguments

expand all

Horizontal alignment, specified as one of these values:

  • 'center' — Centered

  • 'left' — Left justified

  • 'right' — Right justified

  • 'justified' — Left justified and right justified, spacing words evenly

  • 'distributed' — Left justified and right justified, spacing letters evenly

  • 'thaiDistributed' — Left justified and right justified Thai text, spacing characters evenly

  • 'justifiedLow' — Justification for Arabic text

Properties

expand all

ID for this PPT API object, specified as a character vector or string scalar. A session-unique ID is generated as part of the object creation. You can specify an ID to replace the generated ID.

Attributes:

NonCopyable
true

Data Types: char | string

Tag for this PPT API object, specified as a character vector or string scalar. A session-unique tag is generated 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 issues occur during presentation generation.

Attributes:

NonCopyable
true

Data Types: char | string

Horizontal alignment, specified as one of these values:

  • 'center' — Centered

  • 'left' — Left justified

  • 'right' — Right justified

  • 'justified' — Left justified and right justified, spacing words evenly

  • 'distributed' — Left justified and right justified, spacing letters evenly

  • 'thaiDistributed' — Left justified and right justified Thai text, spacing characters evenly

  • 'justifiedLow' — Justification for Arabic text

Examples

collapse all

The presentation title page in the PPT API default template is to left-justify the title. This example overrides that default by centering the paragraph.

Create a presentation and add a title slide.

import mlreportgen.ppt.*

ppt = Presentation('myHAlignPresentation.pptx');
open(ppt);
titleSlide = add(ppt,'Title Slide');

Create a centered paragraph.

p = Paragraph('Title for First Slide');
p.Style = {HAlign('center')};

Add the paragraph to the slide, generate the presentation, and open myHAlignPresentation.

replace(titleSlide,'Title',p);

close(ppt);
rptview(ppt);

MATLAB®:

Version History

Introduced in R2015b