ページ幅に合わせて拡大縮小するJMP ページ設定にはページに合わせてスケールが付属していますが、静的スカラーを使用せずにスクリプトでこれを実行したいと考えています。 「ページ幅に合わせる」ということは可能でしょうか?
具体的には、スクリプトがページレイアウト(縦または横、余白サイズ)に基づいて「ページ設定を設定」コマンドのスカラーを自動的に選択するようにしたいと考えています。
現在のスクリプト:
Journal << Set page setup(
margins( .4, .4, .4, .4 ),
scale( .67 ), portrait( 0 ),
paper size( "Letter" )
);
そうであってほしいです
Journal << Set page setup(
margins( .4, .4, .4, .4 ), portrait( 0 ),
paper size( "Letter" )
);
ScaleVariable = /* current page setup width divided by maximum width of objects in journal*/ ;
Journal << Set Page Setup( scale ( ScaleVariable ) ) ;
Re: ページ幅に合わせて拡大縮小するJSL の元の抜粋は次のようになります
eval(evalexpr(
Journal << Set page setup( margins( expr(left), expr(top), expr(right), expr(bottom) ),
scale( expr(scale) ), portrait( 1 ), paper size( "Letter" ) )
));
追加の eval(evalexpr( ... expr(...) ...)) 関数は、JMP 10 の時点で存在していた問題 (そしてどうやらまだ存在しているようです) を回避しています。問題は <変数の値を変数に代入するパターンです。
eval/evalexpr ラッパーを省略したと思います。
編集: 開発チームにメモを送信しました。
Re: ページ幅に合わせて拡大縮小する共有してくれてありがとう。
この部分を実行するのが難しいです:
scale( expr(scale) )
jmp16 はこれを数値として認識していないようです。
助言がありますか?
そこに数字を入力した場合にのみ機能します。
ありがとう、
Re: ページ幅に合わせて拡大縮小するこれは美しいです! ありがとう!
Re: ページ幅に合わせて拡大縮小するJMP 10 でも機能する、より良い方法があります。
journal << set Print Headers( "", "", "" );
journal << save pdf( "$temp\test.pdf" );
印刷ヘッダー (必要に応じてフッター) を削除すると、PDF ページの見栄えが大幅に向上します。
PDF without JMP headersPDF without JMP headersJMP ヘッダーのない PDF
Re: ページ幅に合わせて拡大縮小するこれは JMP 12 では非常にうまく機能します。JMP 11 では余分なページ装飾が削除されないため、JMP 10 ではパラメータを SetPageSetup メッセージに送信する必要があります。 (可能であれば 12 (または 13!) にアップグレードすることをお勧めします。)
// 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 );
JMP 11 または 10 の場合は、設定の保存/設定/復元を削除し、JMP 10 の場合は使用を削除します。
// 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 );
ハードコードされた 96 DPI 値に 100% 自信があるわけではありません。また、天井関数が誤って考慮しようとしている丸め誤差がいくつかある可能性があります。
Re: ページ幅に合わせて拡大縮小するそれが役立つ場合は、私はJMP 10.0.2を使用しています
Re: ページ幅に合わせて拡大縮小する私はみんなをつまずかせてしまったでしょうか?