Subscribe Bookmark RSS Feed

Script for saving to PDF

matt_p

Community Trekker

Joined:

May 25, 2012

Hi all,

I have a bunch of graphs that I would like to save to a pdf.

I currently have

Current Journal()<<Save PDF("C:\Documents and Settings\My Documents\myFile.pdf")

This will save my journal as a PDF, but it will be horribly out of scale and across multiple pages.

If I go through File -> Save As -> PDF then I can chose options for scaling/landscape etc.

Is there anyway to get these options for a script? I can't seem to find anything in the guide or index.

Thanks for your help!

-Matt

1 ACCEPTED SOLUTION

Accepted Solutions
carole

Community Trekker

Joined:

Jun 23, 2011

Solution

Hi all,

here is JSL (JMP10) I use to do what is wanted I think...

Regards.

winJOURNAL = CurrentJournal();

//Define setup information to save in pdf

winJOURNAL         <<     Set page setup(

    margins( 0.5, 0.5, 0.5, 0.5 ),

    scale( 0.8 ),

    portrait( 0 ),

    paper size( "A3" )

);

winJOURNAL         <<     get page setup();//get setup information

//Save as PDF

winJOURNAL        <<    SavePDF("C:\Documents and Settings\My Documents\myFile.pdf");

8 REPLIES
joeyjamboadl

Community Member

Joined:

Oct 23, 2012

Hi Matt,

I have a similar problem. Did you get any resolution?

Regards

JJ

tova

Community Trekker

Joined:

Feb 17, 2013

I would also like a resolution if anyone's found one...

carole

Community Trekker

Joined:

Jun 23, 2011

Solution

Hi all,

here is JSL (JMP10) I use to do what is wanted I think...

Regards.

winJOURNAL = CurrentJournal();

//Define setup information to save in pdf

winJOURNAL         <<     Set page setup(

    margins( 0.5, 0.5, 0.5, 0.5 ),

    scale( 0.8 ),

    portrait( 0 ),

    paper size( "A3" )

);

winJOURNAL         <<     get page setup();//get setup information

//Save as PDF

winJOURNAL        <<    SavePDF("C:\Documents and Settings\My Documents\myFile.pdf");

KinKame

Community Trekker

Joined:

Nov 30, 2015

exactly what I needed as well ... JMP is so nice :-)  ... my Christmas present

kahart

Staff

Joined:

Oct 1, 2013

I have had a similar issue.  I found that if I set the window size for each graph prior to adding it to the Journal, I was able to print the Journal and the graphs.

example:

graph1 << size window(920,800);

winJournal()["Graph"] << Apend(Outline Box("Graph",graph1);

I also used similar code as that above for page setup and also had to set the window size for the Journal;

winJOURNAL = CurrentJournal();

//Define setup information to save in pdf

winJOURNAL         <<     Set page setup(

  

    scale( 0.7 ),

);

winJOURNAL         <<    Set Window Size(920, 1000);

It took some time to get the sizes correct based on the graphs.  I found it is very important to go through this effort and to test it with different display resolutions.   Generating a pdf with a lower display resolution will change the scale of the graphs.

arronlee

Community Member

Joined:

Jul 22, 2013

Yup indeed, I agree with kahart. Generating a pdf with a lower display resolution will change the scale of the graphs. So have you found out any fine PDF tools to deal with the problem?

none1

Community Trekker

Joined:

Apr 9, 2014

Hello,

I always do save as ---> PDF and so on.

You can make adjustments to the size of the page, however I have to agree, this is a very bad interface to generate business suitable pdfs.

I hope JMP will look at this issue seriously.

Regards

mattyclown

Community Member

Joined:

Dec 24, 2013

I do not think a 3rd pdf creating tool can offer any proactical help. Maybe you can have a look at following post which uses code to handle the scaling issue of image in pdf.  Anyway, we are looking forward to the expert to offer some guidance.

r - saving graph in pdf or png scaling issue - Stack Overflow