尝试这样的事情。 运气好的话,加上小字体,每份报告都会停留在一页上......
// use the journal to accumulate the reports.
// if they fit on a single page, the page count will be correct.
dt = Open( "$sample_data/big class.jmp", "invisible" );
report = dt << Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ) );
report << journal;
report << closewindow;
report = Bivariate( Y( :weight ), X( :height ), Fit Line );
report << journal;
report << closewindow;
report = Oneway( Y( :height ), X( :sex ), Means( 1 ), Mean Diamonds( 1 ) );
report << journal;
report << closewindow;
Close( dt, nosave );
// add the header and page breaks to the journal
j = Current Journal();
listOfReports = j << child;
nReports = N Items( listOfReports );
// add page breaks
For( i = N Items( listOfReports ), i >= 1, i--,
Insert Into( listOfReports, Page Break Box(), i )
);
// and the header
headerPage = V List Box(
Text Box( "Big Report" ),
Text Box( Format( Today(), "yyyy-mm-dd" ) ),
Text Box( Char( nReports ) || " pages (reports)" )
);
Insert Into( listOfReports, headerPage, 1 );
// make the PDF from the journal
j<<SAVEPDF></SAVEPDF>
使用 Firefox 打开 PDF
编辑:你可能也想要这个:
// make the PDF from the journal
j << setwindowtitle( " " ); // hide the title with a space
j << setpagesetup( {Margins( {0.75, 0.75, 0.75, 0.75} ), Scale( 1 ), Portrait( 1 ), Paper Size( "Letter" )} );
j << savePDF( "$desktop/report.pdf" );
页面设置可能会有所帮助,清理窗口标题会使它看起来好多了!
@davidbarbour