![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174285/image.png)
I need a page-break methodology for PDF output
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Is it possible to create a "new component" or a function that can force a page break in a PDF report?
I am new to MATLAB Report Generator so please be detailed and specific.
Any help would be appreciated.
0 Kommentare
Antworten (1)
Paul Kinnucan
am 12 Mai 2016
Bearbeitet: Paul Kinnucan
am 12 Mai 2016
Hi Riley,
In R2016a, you can use a Report Explorer HTML Text component to simulate a PageBreak component:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174285/image.png)
In this example, the HTML Text component creates a (non-standard) HTML '<PageBreak/>' element. The Report Explorer converts this element to a PDF page break when the output type is Direct PDF (from template).
If you are using the DOM API to generate your report, you can use a DOM PageBreak content object or a PageBreakBefore format object to insert a page break:
import mlreportgen.dom.*
d = Document('MyReport', 'pdf');
append(d, Heading1('Chapter 1'));
h1 = Heading1('Chapter 2');
h1.Style = [h1.Style, {PageBreakBefore}];
append(d, h1);
append(d, PageBreak);
append(d, Heading1('Chapter 3'));
close(d);
rptview(d.OutputPath);
Paul Kinnucan
Engineering Manager
MATLAB and Simulink Report Generators
0 Kommentare
Siehe auch
Kategorien
Mehr zu MATLAB Report Generator finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!