Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.dom.OPCPart class

Package: mlreportgen.dom
Superclasses:

Document part to include in OPC package

Description

Document part to include in an OPC package.

Construction

opcPartObj = OPCPart() creates an empty OPC part.

opcPartObj = OPCPart(name,sourcePath) creates a part having the specified name whose source file is located at the specified path. Appending the part to a document using the Document.package method causes a copy of the source file to be inserted in the document package at the location specified by the part name.

Input Arguments

expand all

Name of part, specified as a character vector.

Path of source file for part, specified as a character vector.

Output Arguments

expand all

OPC part, represented by an mlreportgen.dom.OPCPart object.

Properties

expand all

Specifies the content type, using a file extension. For a list of file content types, see https://en.wikipedia.org/wiki/Open_Packaging_Conventions.

If you do not set this property and the part is one of the types listed below, the DOM interface sets the content type when you append the part to a document.

File TypeFile Extension

Windows® bitmap

.bmp

Cascading style sheet

.css

Plain text

.txt

Icon

.cur

Windows metafile

.emf

Encapsulated PostScript®

.eps

GIF image

.gif

HTML

.html

JPEG image

.jpe

JPEG image

.jpeg

JPEG

.jpg

JavaScript®

.js

JavaScript object Notation

.json

PNG image

.png

PSD

.psd

Rich Text Format

.rtf

Scalable Vector Graphics

.svg

TIFF image

.tif

TIFF image

.tiff

Truetype font

.ttf

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.

Path of this part relative to the root of the package, specified as a character vector. For example, to add an image named myimage.jpg to a document images folder, specify the path as '/images/myimage.jpg'. Specify Name using only ASCII characters.

For information about OPC part names, see https://en.wikipedia.org/wiki/Open_Packaging_Conventions.

For information about OPC part names, see https://en.wikipedia.org/wiki/Open_Packaging_Conventions.

For information about OPC relationship IDs, see https://en.wikipedia.org/wiki/Open_Packaging_Conventions.

Specifies a relationship type, using a file extension. For a list of file content types, see https://en.wikipedia.org/wiki/Open_Packaging_Conventions.

If you do not set this property and the part is one of these types, the DOM interface sets the content type when you append the part to a document.

File TypeFile Extension

Windows bitmap

.bmp

Cascading style sheet

.css

Plain text

.txt

Icon

.cur

Windows metafile

.emf

Encapsulated PostScript

.eps

GIF image

.gif

HTML

.html

JPEG image

.jpe

JPEG image

.jpeg

JPEG

.jpg

JavaScript

.js

JavaScript object Notation

.json

PNG image

.png

PSD

.psd

Rich Text Format

.rtf

Scalable Vector Graphics

.svg

TIFF image

.tif

TIFF image

.tiff

Truetype font

.ttf

Source file path, specified as a character vector.

Tag for document element, specified as a character vector.

A session-unique ID is generated as part of document element creation. The generated tag has the form CLASS:ID, where CLASS is the class of the element and ID is the value of the Id property of the object. You can specify a tag to replace the generated tag.

For example, to make it easier to identify where an issue occurred during document generation, you can specify your own tag value.

Examples

expand all

This code inserts a copy of the data.json file in the data subfolder of the mydoc package. This example assumes that there is a data.json file in the current folder.

import mlreportgen.dom.*;
d = Document('mydoc','html');
package(d,OPCPart('/data/data.json','data.json'));
close(d);
Was this topic helpful?