mlreportgen.dom.Image class

Package: mlreportgen.dom
Superclasses:

Create image to include in report

Description

Create an image to include in a report.

Construction

imageObj = mlreportgen.dom.ImageImage(imagePath) creates an image object containing the image file specified by imagePath.

The contents of the specified image file are copied into the output document when the document is closed. Do not delete the original file before it is copied into the document.

Input Arguments

expand all

Path of an image file, specified as a character vector. You can use these image formats.

Image FormatFile ExtensionSupported Document Type
HTMLWordPDF
Windows® bitmap.bmp
Windows metafile.emf  
Graphics Interchange Format .gif
JPEG image.jpg
PDF.pdf  
Portable Network Graphics .png
Scalable Vector Graphics.svg
TIFF image.tif 

Output Arguments

expand all

Image represented by an mlreportgen.dom.Image object.

Properties

expand all

The output format must support the custom attributes of this document element.

Watermark height, specified in the form valueUnits. Use any of these values for units:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Alternatively, you can specify the image height using the Image.Style property. For example:

Image.Style = {Height('4in')};

Example: '22pi'

ID for this document element, specified as a character vector. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Map of hyperlink areas in image, specified as an mlreportgen.dom.ImageMap object

Path of image file, specified as a character vector.

Format objects that specify the format of a document element.

Name of image style, specified as a character vector. The style name is the name of a style specified in the style sheet of the document or document part to which this image is appended. The specified style defines the appearance of this image in the output document where not overridden by the formats specified by the Style property of this element.

Note

Word output ignores the style name.

Tag for the document element, specified as a character vector.

The DOM generates a session-unique tag when it creates the document element. Structure the tag as class:id, where class is the class of the element and id is the value of the Id property. You can specify a tag to replace the generated tag. Specifying your own tag can make it easier to identify where an issue occurred during document generation.

Image width in the form valueUnits, where Units is an abbreviation for the units. These abbreviations are valid:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Methods

Method

Purpose

append

Use Image.append in a similar way to how you use ExternalLink.append.

Append a custom element to this image.

clone

Use Image.clone in a similar way to how you use Paragraph.clone.

Clone this image

Compatibility Considerations

expand all

Behavior changed in R2019b