ちょっとJMPコミュニティ
私はJSLを初めて使用し、過去1週間ほどスクリプトに取り組んでいます。 スクリプトの最後の部分は、グラフを取得して PDF として保存することになっています。 私が抱えている問題は、この PDF を 1 ページに縮小する方法が見つからないことです。
これは、グラフ ウィンドウで [名前を付けて保存] をクリックし、PDF ファイル形式を選択して、スケールを 80% に設定することで、手動で行うことができます。
現在、私のコードは次のようになっています。
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);
「KlingonImage」は、グラフを表示するために作成されたウィンドウの名前です。 スケール値を何にしても、結果の PDF ファイルに変更はないようです。 これはJMPでできることですか? 私はJMP 9を使用していることに注意してください。
ありがとう、
マイケル
これをスクリプトの最後に追加するとどうなりますか?
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>
ページの左上に野球カードのような pdf (スクリプトが保存されているディレクトリ) が表示されると思います。
「ポートレート」引数の場合、1 はポートレート、0 はランドスケープです。
ヘイ・バイロン
返事が遅くなってごめん。 これで私が抱えている問題が解決するとは思いません。 すべてを 1 ページに収めたい。 ページに収めたいのは、次の要素だけです。
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()
);これは基本的に、テキストボックスが重ねられた画像です。 私が抱えている問題は、PDF ファイルの縮尺に影響を与えないように見えることです。 スケーリングしようとしているウィンドウのタイプは、操作できないデータ タイプですか?
ありがとう、
マイケル
み、
圧縮しようとしているレポートの複雑さ/サイズは?
v9 には特別な何かがあるのかもしれません。私は v7 でこのようなことをしていましたが、うまくいきました。
この例では、レポートの断片をまとめるときに Page Break Box() を追加しました。 PDF が作成されると、ページ ブレークが生成されるため、レポート オブジェクトが不十分にクリップされるのではなく、必要な場所でブレークが発生します。
-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 ) ));
@マイケルグルーム書きました:
ちょっとJMPコミュニティ
私はJSLを初めて使用し、過去1週間ほどスクリプトに取り組んでいます。 スクリプトの最後の部分は、グラフを取得して PDF として保存することになっています。 私が抱えている問題は、この PDF を 1 ページに縮小する方法が見つからないことです。
これは、グラフ ウィンドウで [名前を付けて保存] をクリックし、PDF ファイル形式を選択して、スケールを 80% に設定することで、手動で行うことができます。
現在、私のコードは次のようになっています。
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);
「KlingonImage」は、グラフを表示するために作成されたウィンドウの名前です。 スケール値を何にしても、結果の PDF ファイルに変更はないようです。 これはJMPでできることですか? 私はJMP 9を使用していることに注意してください。
ありがとう、
マイケル
<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" );