How to add images or logos into PDF/DOCX reports generated through Simulink Test Manager

12 ビュー (過去 30 日間)
How to add images or logos into PDF/DOCX reports generated through Simulink Test Manager

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 1 月 24 日
編集済み: MathWorks Support Team 2025 年 2 月 4 日
Simulink Test Manager uses MATLAB Report Generator to generate PDF/DOCX reports. You can add images or logos to the same, using the following:
For DOCX reports,
                Note: You can easily add images/logos to the template. See the section about adding images in the above link.
  • Then, you can generate your test reports using the template created in the previous step. To get instructions on how to generate reports using a template, run the following command in MATLAB R2019b:
web(fullfile(docroot, 'sltest/ug/create-a-test-results-report.html'))
For PDF/HTML reports,
  • To create a PDF template, follow the instructions by executing this command in MATLAB R2019b:
web(fullfile(docroot, 'rptgen/ug/create-an-html-or-pdf-template.html'))
  • For adding holes to the template, refer to the documentation by running this command in MATLAB R2019b:
web(fullfile(docroot, 'rptgen/ug/add-holes-in-an-html-template.html'))
There is also an example PDF template, 'sltestPDFReportTemplateExample.pdftx', in the help\toolbox\sltest\examples folder (a DOCX template also exists there). To add an image to this template, do the following:
        1. Copy the template file to a working directory.
2. Unzip the template with this command:
>> unzipTemplate('sltestPDFReportTemplateExample.pdftx');
        This creates a folder named 'sltestPDFReportTemplateExample'.
3. Copy the image you want to insert into the sltestPDFReportTemplateExample/images folder.
4. Open the file sltestPDFReportTemplateExample/root.html. You should see some holes already inserted in the report.
5. Wherever you want the image, insert an HTML "img" element. You can make other changes to the root.html file using HTML.
<img src="images/myImageFile.png"></img>
        6. After all modifications to the template file, zip the template files back into a PDFTX file:
>> zipTemplate('myCustomTemplate.pdftx', 'sltestPDFReportTemplateExample');
        7. Make sure to use the new template for report generation.
Please follow the link below to search for the required information regarding the current release:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResults, Reporting, and Test File Management についてさらに検索

タグ

タグが未入力です。

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by