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

10 vues (au cours des 30 derniers jours)
How to add images or logos into PDF/DOCX reports generated through Simulink Test Manager

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 24 Jan 2025
Modifié(e) : MathWorks Support Team le 4 Fév 2025
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:

Plus de réponses (0)

Catégories

En savoir plus sur Results, Reporting, and Test File Management dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by