How to scale titlepage image?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
John
le 10 Juin 2020
Réponse apportée : Rahul Singhal
le 15 Juin 2020
report generator, titlepage, how to scale the image or resize the displayed image?
It's wired that it needs the path instead of image itself.
In the "doc titlepage", it shows "abstract', legal note" fields, but not available.
0 commentaires
Réponse acceptée
Rahul Singhal
le 15 Juin 2020
Hi John,
Considering you are using Report API, you can specify the TitlePage object's Image property as a DOM Image object instead of the image path. The DOM Image class has properties to specify custom height and width. With DOM Image, you can also use ScaleToFit format to automatically scale a large image to fit the page boundaries.
Below is an example that adds a custom size image to the title page:
% Create a report
rpt = mlreportgen.report.Report('output','pdf');
% Create title page
tp = mlreportgen.report.TitlePage();
tp.Title = 'Title Page Example';
tp.Subtitle = 'Report API';
tp.Publisher = 'MathWorks';
tp.PubDate = date();
% Add a custom size image to the title page
domImage = mlreportgen.dom.Image(which('b747.jpg'));
domImage.Height = '3in';
domImage.Width = '3in';
tp.Image = domImage;
% Add the title page reporter to the report
add(rpt,tp);
% Close and view the output document
rptview(rpt);
Thanks,
Rahul
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Title Pages, Tables of Contents, Lists of Figures, Tables, and Captions dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!