how can i create a pdf report with both portrait and landscape orientation?
2 次查看(过去 30 天)
显示 更早的评论
I am trying to create a pdf report that concludes many graphics. Some graphics demand landscape orientation. How can I include lansdcape oriented pages in a portrait oriented report?
Thank you
0 个评论
回答(2 个)
Sean de Wolski
2016-12-12
编辑:Sean de Wolski
2016-12-12
Try this:
import mlreportgen.dom.*
rpt = Document('output','docx');
append(rpt, Heading1('Hello'));
clonedSection = rpt.CurrentPageLayout.clone();
section = DOCXSection();
section.PageSize.Orientation = 'landscape';
section.PageSize.Height = '8.5in';
section.PageSize.Width = '11in';
append(rpt, section);
append(rpt, magic(15));
append(rpt,clonedSection);
append(rpt, Heading1('World'));
close(rpt);
rptview(rpt);
If you're using templates, then the template dotx files can be landscape and you can append them as DocumentPart-s
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!