www.gusucode.com > rptgen 案例源码程序 matlab代码 > rptgen/ChangePageMarginsofaDocumentSectionExample.m

    %% Change Page Margins of a Document Section  

%% 
% Create a PDF report using the default template. Open the document and
% assign the |CurrentPageLayout| property to a variable. Change the left
% and right margins for this layout. 
import mlreportgen.dom.*;
d = Document('mydoc','pdf');

open(d);
s = d.CurrentPageLayout;
s.PageMargins.Left = '2in';
s.PageMargins.Right = '2in';
p = Paragraph('Hello World');
append(d,p);

close(d);
rptview(d.OutputPath);