페이지 너비에 맞게 크기 조정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: 페이지 너비에 맞게 크기 조정내가 모두를 당황하게 만들었나요?