Salve comunità JMP
Sono nuovo in JSL e ho lavorato a una sceneggiatura nell'ultima settimana o giù di lì. La parte finale dello script dovrebbe prendere un grafico e salvarlo come PDF. Il problema che sto riscontrando è che non riesco a trovare un modo per ridimensionare questo PDF a una pagina.
Posso farlo manualmente facendo clic su "Salva con nome" nella finestra del grafico, scegliendo il formato del file PDF e impostando la scala all'80%.
Attualmente, il mio codice è simile a questo:
KlingonImage << Set Page Setup(
margins(0.5,0.5,0.5,0.5),
scale(0.8)
);
KlingonImage << Get Page Setup();
//Save as PDF
KlingonImage << Savepdf(filepath);
Dove "KlingonImage" è il nome della finestra creata per visualizzare il grafico. Indipendentemente dal valore della scala, non sembra esserci alcun cambiamento nel file PDF risultante. È qualcosa che JMP può fare? Va notato che sto usando JMP 9.
Grazie,
Michael
cosa succede quando lo aggiungi alla fine del tuo script?
gb <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN> Set page setup<SPAN class="token punctuation">(</SPAN> margins<SPAN class="token punctuation">( 0.5, 0.5, 0.5, 0.5 </SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> scale<SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">.1</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> portrait<SPAN class="token punctuation">(</SPAN> 0 <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> paper size<SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"Letter"</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token comment">gb << save pdf( "testPDF.pdf" );</SPAN>
Sospetto che otterrai un pdf (nella directory in cui è salvato lo script) che assomiglia a una carta da baseball in alto a sinistra della pagina.
nota, per l'argomento "ritratto", 1 è verticale e 0 è orizzontale.
Ciao Byron
Scusa per la risposta in ritardo. Non credo che questo risolva il problema che sto riscontrando. Voglio che tutto stia in una sola pagina. L'unica cosa che voglio inserire nella pagina è questo elemento:
KlingonImage=New Window("Klingon Pattern",
gb=Graph Box(
Frame Size(810,810),
xaxis(show major ticks(false),show minor ticks(false),show labels(false)),
yaxis(show major ticks(false),show minor ticks(false),show labels(false)),
X Scale(0,100),
Y Scale(0,100),
<< Add Image(
Open(filepath||fid1),
Bounds(
Left(20),
Right(80),
Top(100),
Bottom(0)
)
),
Text Size(11);
Text Color("black"),
Text(Center Justified,Boxed,{50,3.9},NFrame), //North Frame
Text(Center Justified,Boxed,{40,96},SETFrame), //Southeast Top Frame
Text(Center Justified,Boxed,{60,96},SWTFrame), //Southwest Top Frame
Text(Center Justified,Boxed,{50,9},NWindow), //North Window
Text(Center Justified,Boxed,{50,81.5},SWindow), //South Window
Text(Center Justified,Clockwise,Boxed,{36.5,80},SEWindowOut), //Outer Southeast Window
Text(Center Justified,Clockwise,Boxed,{62.5,80},SWWindowOut), //Outer Southwest Window
Text(Center Justified,Clockwise,Boxed,{62.5,12},NWWindowOut), //Outer Northwest Window
Text(Center Justified,Clockwise,Boxed,{36.5,12},NEWindowOut), //Outer Northeast Window
Text(Center Justified,Clockwise,Boxed,{74.3,27},NWFrame), //Northwest Frame
Text(Center Justified,Clockwise,Boxed,{25,27},NEFrame), //Northeast Frame
Text(Center Justified,Clockwise,Boxed,{74.3,72},SWFrame), //Southwest Frame
Text(Center Justified,Clockwise,Boxed,{25,72},SEFrame), //Southeast Frame
Text(Center Justified,Clockwise,Boxed,{42,30},NEWindowIn), //Inner Northeast Window
Text(Center Justified,Clockwise,Boxed,{42,63},SEWindowIn), //Inner Southeast Window
Text(Center Justified,Clockwise,Boxed,{57.7,30},NWWindowIn), //Inner Northwest Window
Text(Center Justified,Clockwise,Boxed,{57.6,63},SWWindowIn), //Inner Southwest Window
Text(Center Justified,Boxed,{34,45.5},NEGap), //Northeast Gap
Text(Center Justified,Boxed,{34.4,51},SEGap), //Southeast Gap
Text(Center Justified,Boxed,{67,45.5},NWGap), //Northwest Gap
Text(Center Justified,Boxed,{67,51},SWGap), //Southwest Gap
Text Color("Blue"),
Text({74,5},Operator), //Operator
Text({74,1},TestDate); //Date
Text({74,3},NumberSamp); //Number of Samples used in generation
),
Page Break Box()
);Che è essenzialmente un'immagine con caselle di testo sovrapposte. Il problema che sto riscontrando è che non riesco a influenzare la scala del file PDF. Il tipo di finestra che sto cercando di ridimensionare è un tipo di dati che non posso manipolare?
Grazie,
Michael
M,
Quanto è complesso/grande il report che stai tentando di comprimere?
Forse c'è qualcosa di speciale in v9, facevo qualcosa di simile in v7 e ha funzionato bene.
In questo esempio, quando ho messo insieme i pezzi del report, ho aggiunto un Page Break Box(). Quando il PDF viene creato, genera un freno di pagina, quindi invece di finire con oggetti del report ritagliati male, le interruzioni si verificano dove le voglio.
-B
obj = New Window( "KPI Report " || Long Date( Today() ),
V List Box( "vlb1", Panel Box( "Figure 1", graph1 ), <STRONG>Page Break Box()</STRONG>, Panel Box( "Figure 2", graph2 ) ));
@michaelgroom ha scritto:
Salve comunità JMP
Sono nuovo in JSL e ho lavorato a una sceneggiatura nell'ultima settimana o giù di lì. La parte finale dello script dovrebbe prendere un grafico e salvarlo come PDF. Il problema che sto riscontrando è che non riesco a trovare un modo per ridimensionare questo PDF a una pagina.
Posso farlo manualmente facendo clic su "Salva con nome" nella finestra del grafico, scegliendo il formato file PDF e impostando la scala all'80%.
Attualmente, il mio codice è simile a questo:
KlingonImage << Set Page Setup(
margins(0.5,0.5,0.5,0.5),
scale(0.8)
);
KlingonImage << Get Page Setup();
//Save as PDF
KlingonImage << Savepdf(filepath);
Dove "KlingonImage" è il nome della finestra creata per visualizzare il grafico. Indipendentemente dal valore della scala, non sembra esserci alcun cambiamento nel file PDF risultante. È qualcosa che JMP può fare? Va notato che sto usando JMP 9.
Grazie,
Michael
<BR /> obj << Set page setup( margins( 1, 1, 1, 1 ), scale( .5 ), portrait( 1 ), paper size( "Letter" ) ); path = Get Default Directory(); //t=Format Date( Today(), "ddmonyyyy" ); obj << save pdf( path || "testPDF.pdf" );