this works pretty well in JMP 12. JMP 11 does not remove the extra page decorations, and JMP 10 needs help sending the parameters to the SetPageSetup message. (Recommending upgrade to 12 (or 13!) if possible.)
// your parameters - paper size and margins
pagewidth = 8.5;
pageheight = 11;
left = .4;
right = .4;
top = .4;
bottom = .4;
dt = Open( "$sample_data/big class.jmp" );
// your reports
//plat = dt << runscript( "bivariate" );
//plat << journal;
//plat << closewindow;
plat = dt << runscript( "fit model" );
plat << journal;
plat << closewindow;
journal = Current Journal();
saved = Get Preferences( "print settings" ); // remember decorations, if any
Preferences( Print Settings( Left Header( "" ), Right Header( "" ) ) ); // remove decorations
{xpix, ypix} = journal << getsize;
marginx = left + right;
marginy = top + bottom;
xinch = pagewidth - marginx;
yinch = pageheight - marginy;
xppi = xpix / xinch;
yppi = ypix / yinch;
ppi = Max( xppi, yppi );
scale = 96 / Ceiling( ppi ); // a little guesswork here.
// 96 is the pixels per inch of the destination. 72 is another common possibility.
// force the larger dimension to fit. you could pick a different strategy, make the
// width fit perhaps, or have a minimum scale you don't go below.
Journal << Set page setup( margins( left, top, right, bottom ), scale( scale ), portrait( 1 ), paper size( "Letter" ) );
journal << save pdf( "$temp\test.pdf" );
journal << closewindow;
Open( "$temp\test.pdf" );
eval( saved );
For JMP 11 or 10, remove the preference save/set/restore and for JMP 10 use
// for JMP 10, this will have to suffice...
// your parameters - paper size and margins
pagewidth = 8.5;
pageheight = 11;
left = .4;
right = .4;
top = .4;
bottom = .4;
dt = Open( "$sample_data/big class.jmp" );
// your reports
//plat = dt << runscript( "bivariate" );
//plat << journal;
//plat << closewindow;
plat = dt << runscript( "fit model" );
plat << journal;
plat << closewindow;
journal = Current Journal();
//saved = Get Preferences( "print settings" ); // remember decorations, if any
//Preferences( Print Settings( Left Header( "" ), Right Header( "" ) ) ); // remove decorations
{xpix, ypix} = journal << getsize;
marginx = left + right;
marginy = top + bottom;
xinch = pagewidth - marginx;
yinch = pageheight - marginy;
xppi = xpix / xinch;
yppi = ypix / yinch;
ppi = Max( xppi, yppi );
scale = 96 / Ceiling( ppi ); // a little guesswork here.
// 96 is the pixels per inch of the destination. 72 is another common possibility.
// force the larger dimension to fit. you could pick a different strategy, make the
// width fit perhaps, or have a minimum scale you don't go below.
eval(evalexpr(
Journal << Set page setup( margins( expr(left), expr(top), expr(right), expr(bottom) ),
scale( expr(scale) ), portrait( 1 ), paper size( "Letter" ) )
));
journal << save pdf( "$temp\test.pdf" );
journal << closewindow;
Open( "$temp\test.pdf" );
//eval( saved );
I'm not 100% confident in the hard-coded 96 DPI value, and there may be some rounding errors that the ceiling function is incorrectly trying to account for.
Craige