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

조회 수: 13 (최근 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 CenterFile Exchange에서 Results, 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