API version 4

- ‐

PrintStart

印刷データ生成処理を開始するときに発生します。

関連項目

printDocument メソッド

PageChangePrintEnd イベント



使用例 CRSダウンロード

Form formPrintForm_pageCount {
   x = 0;
   y = 0;
   width = 800;
   height = 600;
   PrintForm printform1 {
           pageCount = 3;

           x = 8; y = 72; width = 256; height = 362;
           TextField textfield1 {
                   x = 16; y = 64; width = 224; height = 32;
                   horizontalAlign = ALIGN_CENTER;
                   value="PrintForm出力サンプル";
           }
           TextField textfield2 {
                   x = 32; y = 128; width = 192; height = 128;
                   value="TextField";
           }
           function onPageChange(e) {
                   print("PrintForm.onPageChange page=", e.page);
                   if (e.page == 1) {
                           textfield2.value = "1ページ目のテキスト";
                   } else if (e.page == 2) {
                           textfield2.value = "2ページ目のテキスト\nThe quick brown fox jumps over the lazy dog.";
                   } else if (e.page == 3) {
                           textfield2.value = "3ページ目のテキスト\nいろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす ん";
                   }
           }
           function onPrintStart(e) {
                   print("PrintForm.onPrintStart");
           }
           function onPrintEnd(e) {
                   print("PrintForm.onPrintEnd");
           }
   }
   Button buttonPrint {
           x = 8; y = 8; width = 56; height = 24;
           title = "印刷";
           function onTouch(e) {
                   ^.printpreview1.clearPages();
                   print("PrintForm.printDocument begin");
                   ^.printpreview1.document = ^.printform1.printDocument();
                   print("PrintForm.printDocument end");
           }
   }
   PrintPreview printpreview1 {
           x = 272; y = 8; width = 488; height = 472;
   }
}