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.

addHTMLFile

Class: mlreportgen.dom.Document
Package: mlreportgen.dom

Append HTML file contents to document

Syntax

documentObjOut = addHTMLFile(documentObj,htmlFilePath)

Description

documentObjOut = addHTMLFile(documentObj,htmlFilePath) appends HTML file contents to a document.

Input Arguments

expand all

Document object to append content to, specified as an mlreportgen.dom.Document object.

HTML file path, specified as a character vector.

Output Arguments

expand all

Document object with HTML file content appended, returned as an mlreportgen.dom.Document object.

Examples

expand all

In a text editor, create a file and enter this text:

<!DOCTYPE html>
<html>

<head>
  <title>My First HTML</title>
 
</head>

<body>

<p>This is the <b>first</b> paragraph.</p>

<p>This is the <b>second</b> paragraph</p>

</body>
</html>

Save the file in the MATLAB® current folder as html_example.html.

Create a Word report.

import mlreportgen.dom.*;
rpt = Document('HTMLReport','docx');     

Append the HTML file content to the document.

addHTMLFile(rpt,'html_example.html');

Generate the Word report.

close(rpt);
rptview(rpt.OutputPath);

Introduced in R2015a

Was this topic helpful?