Hola comunidad JMP
Soy nuevo en JSL y he estado trabajando en un script durante la última semana más o menos. Se supone que la parte final del script debe tomar un gráfico y guardarlo como PDF. El problema que tengo es que parece que no puedo encontrar una manera de reducir este PDF a una página.
Puedo hacer esto manualmente haciendo clic en "Guardar como" en la ventana del gráfico, eligiendo el formato de archivo PDF y configurando la escala al 80%.
Actualmente, mi código se ve así:
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);
Donde "KlingonImage" es el nombre de la ventana creada para mostrar el gráfico. No importa cuál sea el valor de la escala, no parece haber ningún cambio en el archivo PDF resultante. ¿Es esto algo que JMP puede hacer? Cabe señalar que estoy usando JMP 9.
Gracias,
Miguel
¿Qué sucede cuando agregas esto al final de tu 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>
Sospecho que obtendrá un pdf (en el directorio donde se guarda el script) que parece una tarjeta de béisbol en la parte superior izquierda de la página.
nota, para el argumento "retrato", 1 es retrato y 0 es paisaje.
hola byron
Lo siento por la respuesta tardía. No creo que esto solucione el problema que tengo. Quiero que todo quepa en una sola página. Lo único que quiero que quepa en la página es este 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()
);Que es esencialmente una imagen con cuadros de texto superpuestos. El problema que tengo es que parece que no puedo afectar la escala del archivo PDF. ¿El tipo de ventana que intento escalar es un tipo de datos que no puedo manipular?
Gracias,
Miguel
METRO,
¿Qué tan complejo/grande es el informe que está tratando de comprimir?
Tal vez hay algo especial en v9, solía hacer algo como esto en v7 y funcionó bien.
En este ejemplo, cuando junté las partes del informe, agregué un cuadro de salto de página (). Cuando se crea el PDF, genera un salto de página, por lo que en lugar de terminar con objetos de informe mal recortados, los saltos ocurren donde los quiero.
-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 ) ));
@miguelgroom escribió:
Hola comunidad JMP
Soy nuevo en JSL y he estado trabajando en un script durante la última semana más o menos. Se supone que la parte final del script debe tomar un gráfico y guardarlo como PDF. El problema que tengo es que parece que no puedo encontrar una manera de reducir este PDF a una página.
Puedo hacer esto manualmente haciendo clic en "Guardar como" en la ventana del gráfico, eligiendo el formato de archivo PDF y configurando la escala al 80%.
Actualmente, mi código se ve así:
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);
Donde "KlingonImage" es el nombre de la ventana creada para mostrar el gráfico. No importa cuál sea el valor de la escala, no parece haber ningún cambio en el archivo PDF resultante. ¿Es esto algo que JMP puede hacer? Cabe señalar que estoy usando JMP 9.
Gracias,
Miguel
<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" );