- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Set Page Setup for PDF not working as expected
Hello all,
I am running the following code to try and adjust the Page Setup settings for this PDF before exporting it to my desktop. An example of my code looks like this:
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
nw = New Window ("Charts",
obj = dt << Control Chart Builder( Variables( Y( :height, :weight ) ), Show Control Panel( 0 ), SendToReport(
) );
);
nw << Set page setup(
margins( 0.75, 0.75, 0.75, 0.75 ),
scale( 0.8 ),
portrait( 1 ),
paper size( "Tabloid" )
);
nw << Save PDF ("Desktop\EXAMPLE.pdf");
When using this, the PDF document "EXAMPLE" gets to my Desktop but does not seem to take into consideration the 'Set page setup' portion of my code. It is also not throwing an error when getting to the 'Set page setup' line, so it appear to be trying to work, but not actually working.
I also seem to be unable to add the Boolean 1 in the Save PDF function to make the Page Setup pop-up happen.
Does anyone know what I might have done wrong to cause this?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Set Page Setup for PDF not working as expected
For me it seems to be working fine when using JMP17.0. Which version of JMP are you using? Also the path to Desktop might be incorrect (try to add $)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("Charts",
obj = dt << Control Chart Builder(
Variables(Y(:height, :weight)),
Show Control Panel(0),
);
);
nw << Set page setup(margins(0.75, 0.75, 0.75, 0.75), scale(0.2), portrait(1), paper size("Tabloid"));
nw << Save PDF("$Desktop\EXAMPLE.pdf");
Open("$Desktop\EXAMPLE.pdf");
at least scale does work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Set Page Setup for PDF not working as expected
I am using JMP 17.0. The PDF file was not having issues with exporting to my desktop. Using this code,
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("Charts",
obj = dt << Control Chart Builder(
Variables(Y(:height, :weight)),
Show Control Panel(0),
);
);
nw << Set page setup(margins(0.75, 0.75, 0.75, 0.75), scale(0.2), portrait(1), paper size("Tabloid"));
nw << Save PDF("$Desktop\EXAMPLE.pdf");
Open("$Desktop\EXAMPLE.pdf");
nw << Set page setup(margins(0.5, 0.5, 0.5, 0.5), scale(0.8), portrait(0), paper size("Letter"));
nw << Save PDF("$Desktop\EXAMPLE 2.pdf");
Open("$Desktop\EXAMPLE 2.pdf");
I set the Page Setup portion up two separate ways and the two PDFs that are exporting look exactly the same (EXAMPLE and EXAMPLE 2). This is the reason I believe the 'page setup' portion is not being considered. Are you saying you do not have this issue?
Edit: I am able to get the above to export two different PDFs now. My issue was because the JMP script I was using was being housed inside a project. As far as I can tell, 'Set page setup' instructions do no work when they are within a script, within a project. Is there a workaround currently available for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Set Page Setup for PDF not working as expected
Maybe creating journal of the new window would help with the project issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Set Page Setup for PDF not working as expected
Appreciate the suggestion! I tried moving the charts to a journal and then running 'Set page setup' from there but that did not appear to have an impact on the exported PDF. When running the below, making changes to the 'Set page setup' function still does not affect the PDF.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("Charts",
obj = dt << Control Chart Builder(
Variables(Y(:height, :weight)),
Show Control Panel(0),
);
);
nw << Set page setup(margins(0.75, 0.75, 0.75, 0.75), scale(0.8), portrait(1), paper size("Tabloid"));
nw << Journal();
nw_journal = Current Journal();
nw_journal << Save PDF("$Desktop\EXAMPLE.pdf");
Open("$Desktop\EXAMPLE.pdf");
Please let me know if this is not the proper way to go about adding the 'Charts' window to a journal. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Set Page Setup for PDF not working as expected
Hi, did you manage to solve this issue? I'm facing a similar problem.
When I use the example code from the scripting index, it doesn't seem to work for me either. Here's the example code:
Names Default To Here( 1 );
//This message applies to all display box objects
w = New Window( "Window", Text Box( "Page Setup Test" ) );
w << Set page setup( margins( 1, 1, 1, 1 ), scale( 1 ), portrait( 1 ), paper size( "Letter" ) );
w << save pdf( "$DOCUMENTS\test.pdf" );
no matter the values I set in the arguments I get exactly the same PDF.
I am using JMP 17.2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Set Page Setup for PDF not working as expected
I get very different .pdf when I change the settings (but I'm using JMP18)
Names Default To Here(1);
w = New Window("Window", Text Box("Page Setup Test"));
w << Set page setup(margins(1, 1, 1, 1), scale(1), portrait(1), paper size("Letter"));
w << save pdf("$DOCUMENTS\test.pdf");
w << Set page setup(margins(0.5, 0.5, 0.5, 0.5), scale(0.5), portrait(0), paper size("Letter"));
w << save pdf("$DOCUMENTS\test2.pdf");
Web("$DOCUMENTS\test.pdf");
Web("$DOCUMENTS\test2.pdf");