cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit. Register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
WebDesignesCrow
Super User

How to convert Page Setup Setting (PDF) to JSL Script?

Hi Expert,

I'm trying to save my journal report in .pdf through JSL scripting.

My issue now is, I can save the report to fit nicely the landscape page manually using below settings;

WebDesignesCrow_0-1700103417164.png

But, when I converted the setting to JSL script, it stays in portrait.

Why my script not working? I've set the preferences to landscape as default but still not working

// add the header 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 ));
// make the PDF from the journal
j << set window title ("Daily Analysis Report "||format(today(), "d/m/y",10); );
j << set page setup( {margins( {0.75, 0.75, 0.75, 0.75} ), scale( 0.94 ), portrait(0), paper size( "Letter" )} );
// make the PDF from the journal
j << save PDF("$desktop/reportJSL.pdf");uus

using JMP17.0

1 ACCEPTED SOLUTION

Accepted Solutions
WebDesignesCrow
Super User

Re: How to convert Page Setup Setting (PDF) to JSL Script?

Got it.

Somehow, I need to add Wait (0) after set page setup & before save .pdf to make it works.

// add the header 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 ));
// make the PDF from the journal
j << set window title ("Daily Analysis Report "||format(today(), "d/m/y",10); );
j << set page setup( {margins( {0.75, 0.75, 0.75, 0.75} ), scale( 0.94 ), portrait(0), paper size( "Letter" )} );
Wait(0);
// make the PDF from the journal
j << save PDF("$desktop/reportJSL.pdf");

 

View solution in original post

1 REPLY 1
WebDesignesCrow
Super User

Re: How to convert Page Setup Setting (PDF) to JSL Script?

Got it.

Somehow, I need to add Wait (0) after set page setup & before save .pdf to make it works.

// add the header 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 ));
// make the PDF from the journal
j << set window title ("Daily Analysis Report "||format(today(), "d/m/y",10); );
j << set page setup( {margins( {0.75, 0.75, 0.75, 0.75} ), scale( 0.94 ), portrait(0), paper size( "Letter" )} );
Wait(0);
// make the PDF from the journal
j << save PDF("$desktop/reportJSL.pdf");