mlreportgen.ppt.PicturePlaceholder class

Package: mlreportgen.ppt
Superclasses:

Slide placeholder to replace with picture

Description

Slide placeholder to replace with a picture. You can create a picture placeholder using a layout slide. In the default PPT API, when you add a Title and Picture slide to a presentation, the API creates a PicturePlaceholder object. Use the find method with the Slide object to find the picture placeholder. You can then set properties for that PicturePlaceholder object.

Use the PowerPoint® editor to insert a picture placeholder in a presentation.

  1. Select the Slide Master tab.

  2. Click the layout slide you want to add the picture placeholder to. You can add the placeholder to an existing or a new layout slide.

  3. In the toolbar, click Insert Placeholder and select Picture.

Properties

expand all

Picture placeholder name, specified as a character vector.

Upper-left x-coordinate of picture placeholder, specified 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

Upper-left y-coordinate position of picture placeholder, specified 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

Width of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (defaults)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Height of placeholder, specified 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

Picture placeholder formatting. This property is ignored.

Child elements of this object, specified as a cell array of PPT objects. This property is read-only.

Parent of this object, specified as a PPT object. This property is read-only.

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

Tag for this PPT API object, specified as a character vector. 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 an issue occurred during presentation generation.

Methods

Method

Purpose

replace

Replace picture placeholder with picture

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myPicturePlaceholderPresentation.pptx';
slides = Presentation(slidesFile);
slide1 = add(slides,'Title and Picture');

Create an mlreportgen.ppt.Picture object.

plane = Picture(which('b747.jpg'));
plane.X = '1in';
plane.Y = '1in';
plane.Width = '3in';
plane.Height = '2in';

The default PPT API Title and Picture layout slide has a Picture object that is a picture placeholder. Use the mlreportgen.ppt.Slide.find method to find an object with the Name property of Picture.

contents = find(slide1,'Picture');

Replace the picture placeholder with the picture.

replace(contents(1),plane);

Close the presentation.

close(slides);

Open myPicturePlaceholderPresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

if ispc
    winopen(slidesFile);
end

Introduced in R2015b