cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
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

2 REPLIES 2
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");

 

Mauro_Gerber
Level IV

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

In JMP 18 this didn't work. I had to get rid of the curly braces to make it work:

j << set page setup(Margins( {0.7, 0.2, 0.2, 0.2} ), Scale( 1 ), Portrait( 1 ),Paper Size( "A4" ));

 

"I thought about our dilemma, and I came up with a solution that I honestly think works out best for one of both of us"
- GLaDOS

Recommended Articles