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
creates
an empty OPC part.opcPartObj
= OPCPart()
creates
a part having the specified name whose source file is located at the
specified path. Appending the part to a document using the opcPartObj
= OPCPart(name
,sourcePath
)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
name
— Name of part
character vector
Name of part, specified as a character vector.
sourcePath
— Path of source file for part
character vector
Path of source file for part, specified as a character vector.
Output Arguments
opcPartObj
— OPC part
mlreportgen.dom.OPCPart
object
OPC part, represented by an mlreportgen.dom.OPCPart
object.
Properties
ContentType
— Content type of part
character vector
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 Type | File Extension |
---|---|
Windows® bitmap |
|
Cascading style sheet |
|
Plain text |
|
Icon |
|
Windows metafile |
|
Encapsulated PostScript® |
|
GIF image |
|
HTML |
|
JPEG image |
|
JPEG image |
|
JPEG |
|
JavaScript® |
|
JavaScript object Notation |
|
PNG image |
|
PSD |
|
Rich Text Format |
|
Scalable Vector Graphics |
|
TIFF image |
|
TIFF image |
|
Truetype font |
|
Id
— ID for this document element
character vector | string scalar
ID for this document element, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.
Name
— Path of part
character vector
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.
RelatedPart
— Path name of part to which specified part is related
character vector
For information about OPC part names, see https://en.wikipedia.org/wiki/Open_Packaging_Conventions.
RelationshipID
— Relationship ID
character vector
For information about OPC relationship IDs, see https://en.wikipedia.org/wiki/Open_Packaging_Conventions.
RelationshipType
— Relationship type
character vector
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 Type | File Extension |
---|---|
Windows bitmap |
|
Cascading style sheet |
|
Plain text |
|
Icon |
|
Windows metafile |
|
Encapsulated PostScript |
|
GIF image |
|
HTML |
|
JPEG image |
|
JPEG image |
|
JPEG |
|
JavaScript |
|
JavaScript object Notation |
|
PNG image |
|
PSD |
|
Rich Text Format |
|
Scalable Vector Graphics |
|
TIFF image |
|
TIFF image |
|
Truetype font |
|
SourceFilePath
— Source file path
character vector
Source file path, specified as a character vector.
Tag
— Tag for this document element
character vector | string scalar
Tag for this document element, specified as a character vector or string scalar.
The DOM 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. Specifying your own tag value can
help you to identify where an issue occurred during document generation.
Examples
Add a File to an OPC Package
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);
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)