Ignore:
Timestamp:
2007/07/20 15:58:59 (19 years ago)
Author:
nanasess
Message:

r15064 から svn cp
とりあえず暫定コミット.

  • UTF-8 に変更
  • slib.php, glib.php のクラス化
  • LC_Page の抽象化(一部)
Location:
branches/feature-module-update
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update

    • Property svn:ignore set to
      .cache

      .settings

      .projectOptions
  • branches/feature-module-update/data/class/SC_Pdf.php

    r12157 r15078  
    77 
    88/*---------------------------------------------------------------------- 
    9  * [̾¾Î] GC_Pdf 
    10  * [³µÍ×] Pdf¥Õ¥¡¥¤¥ë¤òɽ¼¨¤¹¤ë¡£(PDFLibɬ¿Ü) 
     9 * [名称] GC_Pdf 
     10 * [概要] Pdfファイルを表示する。(PDFLib必須) 
    1111 *---------------------------------------------------------------------- 
    1212 */ 
    1313 
    14 // ¥°¥ê¥Ã¥É¤Èʸ»ú¤Î´Ö³Ö  
     14// グリッドと文字の間隔  
    1515define("GRID_SPACE", 4); 
    1616 
     
    2929        $this->license_key = "B600602-010400-714251-5851C1"; 
    3030        $this->src_code = CHAR_CODE; 
    31         // UTF-8¤Ç¤Ê¤¤¤È¥Ö¥í¥Ã¥¯Æâ¤Ç²þ¹Ô¤Ç¤­¤Ê¤¤¡£ 
     31        // UTF-8でないとブロック内で改行できない。 
    3232        $this->dst_code = "UTF-8"; 
    33         // PDF BLOCK¤Î¥×¥í¥Ñ¥Æ¥£ 
     33        // PDF BLOCKのプロパティ 
    3434        $this->block_option = "encoding=UniJIS-UCS2-H textformat=utf8 fontname=HeiseiMin-W3 textflow=true"; 
    35         // ·Ù¹ðɽ¼¨ 
     35        // 警告表示 
    3636        $this->pdiwarning = "true";  
    37         // ¥Ú¡¼¥¸¥µ¥¤¥ºÀßÄê 
     37        // ページサイズ設定 
    3838        $this->width = $width; 
    3939        $this->height = $height; 
    40         // PDF½é´ü²½ 
     40        // PDF初期化 
    4141        $this->pdf = PDF_new(); 
    4242        PDF_set_parameter($this->pdf, "license", $this->license_key); 
    4343        PDF_set_parameter($this->pdf, "pdiwarning", $this->pdiwarning); 
    44         // ¥É¥­¥å¥á¥ó¥È³«»Ï 
     44        // ドキュメント開始 
    4545        PDF_begin_document($this->pdf, NULL, NULL); 
    46         // ¥Ú¡¼¥¸¤Î¾õÂÖ 
     46        // ページの状態 
    4747        $this->page_open = false; 
    48         // ¥Æ¡¼¥Ö¥ë¤Î¿§ÀßÄê 
     48        // テーブルの色設定 
    4949        $this->setTableColor(); 
    50         // ¥Õ¥©¥ó¥È¥µ¥¤¥º¤ÎÀßÄê 
     50        // フォントサイズの設定 
    5151        $this->fontsize = $fontsize; 
    52         // ¥°¥ê¥Ã¥ÉÉÁ²è¤ÎÆÃ¼ì»ØÄê 
     52        // グリッド描画の特殊指定 
    5353        $this->arrLines = array(); 
    54         // ¥Æ¡¼¥Ö¥ë¥¿¥¤¥È¥ë¤Î¥¹¥¿¥¤¥ë 
     54        // テーブルタイトルのスタイル 
    5555        $this->arrHeaderColSize = array(); 
    5656        $this->arrHeaderAlign = array(); 
    57         // ¥Æ¡¼¥Ö¥ëÊäÀµÃÍ 
     57        // テーブル補正値 
    5858        $this->table_left = 0; 
    59         // ¥¿¥¤¥È¥ë¹Ô¤Î½ÐÎÏ 
     59        // タイトル行の出力 
    6060        $this->title_enable = true; 
    61         // ¥°¥ê¥Ã¥É¤Î½ÐÎÏ 
     61        // グリッドの出力 
    6262        $this->grid_enable = true; 
    6363    } 
    6464     
    65     // ¥¿¥¤¥È¥ë¤ò½ÐÎϤ¹¤ë¤«Èݤ« 
     65    // タイトルを出力するか否か 
    6666    function setTitleEnable($flag) { 
    6767        $this->title_enable = $flag; 
    6868    } 
    6969     
    70     // ¥°¥ê¥Ã¥É¤ò½ÐÎϤ¹¤ë¤«Èݤ« 
     70    // グリッドを出力するか否か 
    7171    function setGridEnable($flag) { 
    7272        $this->grid_enable = $flag; 
     
    7474         
    7575         
    76     // ¥­¡¼¡§¥Ö¥í¥Ã¥¯Ì¾¡¢ÃÍ¡§É½¼¨¥Æ¥­¥¹¥È¤Î¥Ï¥Ã¥·¥åÇÛÎó¤ò¥»¥Ã¥È¤¹¤ë¡£ 
     76    // キー:ブロック名、値:表示テキストのハッシュ配列をセットする。 
    7777    function setTextBlock($list) { 
    7878        unset($this->arrText); 
     
    8080    } 
    8181     
    82     // ¥­¡¼¡§¥Ö¥í¥Ã¥¯Ì¾¡¢ÃÍ¡§¥Õ¥¡¥¤¥ë¥Ñ¥¹¤Î¥Ï¥Ã¥·¥åÇÛÎó¤ò¥»¥Ã¥È¤¹¤ë¡£ 
    83     // ¢¨¥Ñ¥¹¤Ï¥É¥­¥å¥á¥ó¥È¥ë¡¼¥È°Ê²¼ 
     82    // キー:ブロック名、値:ファイルパスのハッシュ配列をセットする。 
     83    // ※パスはドキュメントルート以下 
    8484    function setImageBlock($list) { 
    8585        unset($this->arrImage); 
     
    8787    } 
    8888     
    89     // ɽ¼¨ÇØ·Ê¤È¤Ê¤ë¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¥Ñ¥¹ 
    90     // ¢¨¥Ñ¥¹¤Ï¥É¥­¥å¥á¥ó¥È¥ë¡¼¥È°Ê²¼ 
     89    // 表示背景となるテンプレートファイルパス 
     90    // ※パスはドキュメントルート以下 
    9191    function setTemplate($pdfpath) { 
    9292        if(file_exists($pdfpath)) { 
    9393            $this->pdfpath = $pdfpath; 
    9494        } else { 
    95             print("»ØÄꤷ¤¿PDF¥Æ¥ó¥×¥ì¡¼¥È¤Ï¸ºß¤·¤Þ¤»¤ó¡§".$pdfpath); 
     95            print("指定したPDFテンプレートは存在しません:".$pdfpath); 
    9696            exit; 
    9797        } 
    9898    } 
    9999     
    100     // ¥Æ¡¼¥Ö¥ë°ÌÃÖÊäÀµÃÍ 
     100    // テーブル位置補正値 
    101101    function setTableLeft($table_left) { 
    102102        $this->table_left = $table_left; 
    103103    } 
    104104     
    105     // ¥°¥ê¥Ã¥ÉÉÁ²è¤ÎÆÃ¼ì»ØÄê 
     105    // グリッド描画の特殊指定 
    106106    function setGridLines($list) { 
    107107        $this->arrLines = $list; 
    108108    } 
    109109     
    110     // ¥Æ¡¼¥Ö¥ë¥¿¥¤¥È¥ë¤Î¥¹¥¿¥¤¥ëÀßÄê 
     110    // テーブルタイトルのスタイル設定 
    111111    function setTableHeaderStyle($arrColSize, $arrAlign) { 
    112112        $this->arrHeaderColSize = $arrColSize; 
     
    114114    } 
    115115     
    116     // ¥Ö¥í¥Ã¥¯¥Ç¡¼¥¿¤Î½ñ¤­¹þ¤ß(close¤¹¤ë¤È¼¡²ó¿·µ¬¥Ú¡¼¥¸) 
     116    // ブロックデータの書き込み(closeすると次回新規ページ) 
    117117    function writeBlock() { 
    118         // ¥Æ¥ó¥×¥ì¡¼¥È¤ò»ÈÍѤ¹¤ë 
     118        // テンプレートを使用する 
    119119        if(!file_exists($this->pdfpath)) { 
    120120            return; 
    121121        } 
    122         // ´û¸PDF¤Î¥É¥­¥å¥á¥ó¥È¤ò¼èÆÀ 
     122        // 既存PDFのドキュメントを取得 
    123123        $doc = pdf_open_pdi($this->pdf, $this->pdfpath, NULL, 0 ); 
    124         // ´û¸PDF¤Î¥É¥­¥å¥á¥ó¥È¤«¤é»ØÄê¥Ú¡¼¥¸¤ò¼èÆÀ 
     124        // 既存PDFのドキュメントから指定ページを取得 
    125125        $page = pdf_open_pdi_page($this->pdf, $doc, 1, NULL ); 
    126         // ¥Ú¡¼¥¸¤ò³«¤¯ 
     126        // ページを開く 
    127127        $this->openPage(); 
    128128         
    129         // ´û¸PDF¤Î¥Ú¡¼¥¸¤ò³ä¤êÅö¤Æ¤ë 
     129        // 既存PDFのページを割り当てる 
    130130        PDF_fit_pdi_page($this->pdf, $page, 0, 0, "adjustpage"); 
    131131         
    132         // ¥Æ¥­¥¹¥È¥Ö¥í¥Ã¥¯¤Î½ñ¤­¹þ¤ß 
     132        // テキストブロックの書き込み 
    133133        $max = count($this->arrText); 
    134134        for($i = 0;$i < $max; $i++) { 
    135135            foreach($this->arrText[$i] as $key => $val) { 
    136136                if($val != "") { 
    137                     // ʸ»ú¥³¡¼¥É¤ÎÊÑ´¹ 
     137                    // 文字コードの変換 
    138138                    mb_convert_variables($this->dst_code, $this->src_code, $val); 
    139                     // ½ñ¤­¹þ¤ß 
     139                    // 書き込み 
    140140                    $ret = PDF_fill_textblock($this->pdf, $page, $key, $val, $this->block_option); 
    141141                } 
     
    143143        } 
    144144         
    145         // ¥¤¥á¡¼¥¸¥Ö¥í¥Ã¥¯¤Î½ñ¤­¹þ¤ß 
     145        // イメージブロックの書き込み 
    146146        $max = count($this->arrImage); 
    147147        for($i = 0;$i < $max; $i++) { 
     
    154154        } 
    155155         
    156         // ³ä¤êÅö¤Æ¤¿¥Ú¡¼¥¸¤òÊĤ¸¤ë 
     156        // 割り当てたページを閉じる 
    157157        PDF_close_pdi_page($this->pdf, $page); 
    158         // ³ä¤êÅö¤Æ¤¿¥É¥­¥å¥á¥ó¥È¤òÊĤ¸¤ë 
     158        // 割り当てたドキュメントを閉じる 
    159159        PDF_close_pdi($this->pdf, $doc); 
    160160    } 
    161161     
    162     // ¥Ú¡¼¥¸¤òÊĤ¸¤ë 
     162    // ページを閉じる 
    163163    function closePage() { 
    164164        if($this->page_open) { 
    165             // ¥Ú¡¼¥¸¤òÊĤ¸¤ë 
     165            // ページを閉じる 
    166166            PDF_end_page_ext($this->pdf, NULL); 
    167167            $this->page_open = false; 
     
    169169    } 
    170170     
    171     // ¥Ú¡¼¥¸¤ò³«¤¯ 
     171    // ページを開く 
    172172    function openPage() { 
    173173        if(!$this->page_open) { 
    174             // ¿·¤·¤¤¥Ú¡¼¥¸¤ò³«¤¯    
     174            // 新しいページを開く     
    175175            PDF_begin_page_ext($this->pdf, $this->width, $this->height, NULL); 
    176176            $this->page_open = true; 
     
    178178    } 
    179179     
    180     // ¿·¤·¤¤¥Ú¡¼¥¸¤ò³«¤¯ 
     180    // 新しいページを開く 
    181181    function newPage() { 
    182182        PDF_end_page_ext($this->pdf, NULL); 
     
    184184    } 
    185185     
    186     // ¥¢¥¯¥Æ¥£¥Ö¤Ê¥Ú¡¼¥¸¤Î¥µ¥¤¥º¤ò¼èÆÀ¤¹¤ë 
     186    // アクティブなページのサイズを取得する 
    187187    function getSize() { 
    188188        $this->openPage(); 
     
    192192    } 
    193193     
    194     // ºÂɸ¤òÆþ¤ìÂØ¤¨¤Æ¼èÆÀ¤¹¤ë(º¸²¼(0,0)¤òº¸¾å(0,0)¤ËÊÑ´¹) 
     194    // 座標を入れ替えて取得する(左下(0,0)を左上(0,0)に変換) 
    195195    function posTopDown($x, $y) { 
    196196        $width = 0; 
    197197        $height = 0; 
    198198        list($width, $height) = $this->getSize(); 
    199         // xºÂɸ¤Ï¡¢Êѹ¹¤ÎɬÍפʤ· 
     199        // x座標は、変更の必要なし 
    200200        $pdf_x = $x; 
    201201        $pdf_y = $height - $y; 
     
    203203    } 
    204204     
    205     // ¥Æ¡¼¥Ö¥ë¥«¥é¡¼¤ÎÀßÄê 
     205    // テーブルカラーの設定 
    206206    function setTableColor($frame_color = "000000", $title_color = "F0F0F0", $line_color = "D1DEFE", $last_color = "FDCBFE") { 
    207207        $this->frame_color = $frame_color; 
     
    211211    } 
    212212     
    213     // ¥Æ¡¼¥Ö¥ë¤Î¥°¥ê¥Ã¥É¤òɽ¼¨¤¹¤ë¡£ 
     213    // テーブルのグリッドを表示する。 
    214214    function writeGrid($x, $y, $arrCol, $line_max, $last_color_flg = true) { 
    215         // ¥Æ¡¼¥Ö¥ëÉý 
     215        // テーブル幅 
    216216        $max = count($arrCol); 
    217217        $width = 0; 
     
    221221         
    222222        if($this->title_enable) {  
    223             // ¥¿¥¤¥È¥ë¥°¥ê¥Ã¥ÉÉÁ²è 
     223            // タイトルグリッド描画 
    224224            $this->writeFrameRect($x, $y + GRID_SPACE, $width + GRID_SPACE, $this->fontsize + GRID_SPACE, $this->title_color, $this->frame_color); 
    225225        } 
    226226         
    227         // ¥°¥ê¥Ã¥ÉÆÃ¼ì»ØÄꤢ¤ê 
     227        // グリッド特殊指定あり 
    228228        if(count($this->arrLines) > 0) { 
    229229            $count = count($this->arrLines); 
     
    231231            for($i = 0; $i < $count; $i++) { 
    232232                if(($i % 2) != 0) { 
    233                     // ¹Ô¤Î´Ö³Ö 
     233                    // 行の間隔 
    234234                    $down = ($pos + 1) * $this->fontsize * 1.5; 
    235                     // ÉÁ²è¤¹¤ë½ÄÉý¤òµá¤á¤ë 
     235                    // 描画する縦幅を求める 
    236236                    $height = ($this->fontsize + GRID_SPACE) * $this->arrLines[$i] + ($this->arrLines[$i] - 1); 
    237                     // ¹Ô¥°¥ê¥Ã¥ÉÉÁ²è 
     237                    // 行グリッド描画 
    238238                    $this->writeRect($x, $y + GRID_SPACE + $down, $width + GRID_SPACE, $height, $this->line_color); 
    239239                } 
     
    243243            for($i = 1; $i <= $line_max; $i++) { 
    244244                if(($i % 2) == 0) { 
    245                     // ¹Ô¤Î´Ö³Ö 
     245                    // 行の間隔 
    246246                    $down = $i * $this->fontsize * 1.5; 
    247                     // ¹Ô¥°¥ê¥Ã¥ÉÉÁ²è 
     247                    // 行グリッド描画 
    248248                    $this->writeRect($x, $y + GRID_SPACE + $down, $width + GRID_SPACE, $this->fontsize + GRID_SPACE, $this->line_color); 
    249249                } 
    250250            } 
    251             // ºÇ½ª¹Ô¤Ë¿§¤ò¤Ä¤±¤ë¾ì¹ç 
     251            // 最終行に色をつける場合 
    252252            if($last_color_flg) { 
    253                 // ¹Ô¤Î´Ö³Ö 
     253                // 行の間隔 
    254254                $down = $line_max * $this->fontsize * 1.5; 
    255                 // ¹Ô¥°¥ê¥Ã¥ÉÉÁ²è 
     255                // 行グリッド描画 
    256256                $this->writeRect($x, $y + GRID_SPACE + $down, $width + GRID_SPACE, $this->fontsize + GRID_SPACE, $this->last_color); 
    257257            } 
     
    259259    } 
    260260     
    261     // ¥°¥ê¥Ã¥ÉÍѤΥ¢¥ó¥À¡¼¥é¥¤¥ó¤ò°ú¤¯ 
     261    // グリッド用のアンダーラインを引く 
    262262    /* 
    263         $x          :¥Æ¡¼¥Ö¥ë³«»Ï°ÌÃÖX¼´ 
    264         $y          :¥Æ¡¼¥Ö¥ë³«»Ï°ÌÃÖY¼´ 
    265         $arrCol     :¥«¥é¥à¥µ¥¤¥º¤ÎÇÛÎó 
    266         $line       :¥¢¥ó¥À¡¼¥é¥¤¥ó¤ò°ú¤¯¹Ô 
    267         $start_col  :¥¢¥ó¥À¡¼¥é¥¤¥ó³«»Ï¥«¥é¥à(0:³«»Ï¥«¥é¥à) 
     263        $x          :テーブル開始位置X軸 
     264        $y          :テーブル開始位置Y軸 
     265        $arrCol     :カラムサイズの配列 
     266        $line       :アンダーラインを引く行 
     267        $start_col  :アンダーライン開始カラム(0:開始カラム) 
    268268     */ 
    269269    function writeUnderLine($x, $y, $arrCol, $line, $start_col = 0) { 
    270         // ¥Æ¡¼¥Ö¥ëÉý 
     270        // テーブル幅 
    271271        $max = count($arrCol); 
    272272        $width = 0; 
     
    280280        } 
    281281         
    282         // ¥¢¥ó¥À¡¼¥é¥¤¥ó¤ÎYºÂɸ¤òµá¤á¤ë 
     282        // アンダーラインのY座標を求める 
    283283        $down = ($line + 1) * $this->fontsize * 1.5; 
    284         // ¹Ô¥°¥ê¥Ã¥ÉÉÁ²è 
     284        // 行グリッド描画 
    285285        $sx = $x + $start_x + GRID_SPACE + $this->table_left; 
    286286        $sy = $y + GRID_SPACE + $down - 1; 
     
    291291    } 
    292292     
    293     // ¿¿¤óÃæ²£°ÌÃÖ¤òµá¤á¤ë 
     293    // 真ん中横位置を求める 
    294294    function getXCenter($width) { 
    295295        $page_width = 0; 
     
    300300    } 
    301301     
    302     // ¼«Æ°Ãæ±û¤è¤» 
     302    // 自動中央よせ 
    303303    function writeTableCenter($table, $y, $arrCol, $arrAlign, $line_max = 256, $start_no = 1, $last_color_flg = false) { 
    304         // ¥Æ¡¼¥Ö¥ë¥µ¥¤¥º¼èÆÀ 
     304        // テーブルサイズ取得 
    305305        $width = 0; 
    306306        foreach($arrCol as $val) { 
    307307            $width += $val; 
    308308        } 
    309         // Ãæ±û¤è¤»°ÌÃÖ¼èÆÀ 
     309        // 中央よせ位置取得 
    310310        $x = $this->getXCenter($width) + $this->table_left; 
    311311        list($ret_x, $ret_y) = $this->writeTable($table, $x, $y, $arrCol, $arrAlign, $line_max, $start_no, $last_color_flg); 
    312         // X¼´¤ÎºÂɸ¤òÊÖ¤¹ 
     312        // X軸の座標を返す 
    313313        return array($ret_x, $ret_y); 
    314314    } 
    315315     
    316     // ¥Ç¡¼¥¿¤Î½ñ¤­¹þ¤ß(close¤¹¤ë¤È¼¡²ó¿·µ¬¥Ú¡¼¥¸) 
    317     // $start_no:1¹ÔÌÜ(¥¿¥¤¥È¥ë)¤ò0¤È¤¹¤ë¡£ 
    318     // $line_max:¥¿¥¤¥È¥ë¤ò´Þ¤Þ¤Ê¤¤¹Ô¿ô 
     316    // データの書き込み(closeすると次回新規ページ) 
     317    // $start_no:1行目(タイトル)を0とする。 
     318    // $line_max:タイトルを含まない行数 
    319319    function writeTable($table, $x, $y, $arrCol, $arrAlign, $line_max = 256, $start_no = 1, $last_color_flg = false) { 
    320320        $this->openPage(); 
     
    328328        } 
    329329         
    330         // ¥¿¥¤¥È¥ëÍ­¸ú 
     330        // タイトル有効 
    331331        if($this->grid_enable) { 
    332             // ¥°¥ê¥Ã¥É¤ÎÉÁ²è 
     332            // グリッドの描画 
    333333            $this->writeGrid($x, $y, $arrCol, $line_max, $last_color_flg); 
    334334        } 
    335335         
    336         // Unicode¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤È¤·¤ÆUTF-8¤òÀßÄê 
     336        // UnicodeエンコーディングとしてUTF-8を設定 
    337337        PDF_set_parameter($this->pdf, "textformat", "utf8"); 
    338338         
    339         // ¥¿¥¤¥È¥ëÍ­¸ú 
     339        // タイトル有効 
    340340        if($this->title_enable) { 
    341341            if(count($this->arrHeaderColSize) > 0 && count($this->arrHeaderAlign) > 0 ) { 
     
    345345            }    
    346346                         
    347             // ¥¿¥¤¥È¥ë¹Ô¤Î½ñ¤­¹þ¤ß 
     347            // タイトル行の書き込み 
    348348            $option = "ruler {" . $linecol . "} "; 
    349349            $option.= "tabalignment {" . $aligncol . "} "; 
     
    356356        list($linecol, $aligncol, $width) = $this->getTableOption($arrCol, $arrAlign); 
    357357         
    358         // ¥Ç¡¼¥¿¹Ô¤Î½ñ¤­¹þ¤ß 
     358        // データ行の書き込み 
    359359        $option = "ruler {" . $linecol . "} "; 
    360360        $option.= "tabalignment {" . $aligncol . "} "; 
     
    376376     
    377377    function getTableOption($arrCol, $arrAlign) { 
    378         // ¥«¥é¥à¥µ¥¤¥º 
     378        // カラムサイズ 
    379379        $max = count($arrCol); 
    380380        $width = 0; 
     
    384384        } 
    385385         
    386         // ¥«¥é¥à°ÌÃÖ 
     386        // カラム位置 
    387387        $max = count($arrAlign); 
    388388        for($i = 0; $i < $max; $i++) { 
     
    393393    } 
    394394     
    395     // ¥Æ¡¼¥Ö¥ë¥Ç¡¼¥¿¤Î½ñ¤­¹þ¤ß 
     395    // テーブルデータの書き込み 
    396396    function writeTableData($table, $x, $y, $table_width, $start_no, $end_no, $option) { 
    397397        $arrLine = split("\n", $table); 
     
    400400        } 
    401401                 
    402         // ¥Æ¡¼¥Ö¥ë°ÌÃÖ¤òµá¤á¤ë 
     402        // テーブル位置を求める 
    403403        list($pdf_x, $pdf_y) = $this->posTopDown($x, $y); 
    404404                         
    405         // ¥Æ¡¼¥Ö¥ë¹â¤µ¤òµá¤á¤ë 
     405        // テーブル高さを求める 
    406406        $table_height = $this->fontsize * 1.5 * ($end_no - $start_no + 1); 
    407         // ¥Æ¡¼¥Ö¥ë±¦²¼¤ÎyºÂɸ¤òµá¤á¤ë 
     407        // テーブル右下のy座標を求める 
    408408        $end_y = $pdf_y - $table_height; 
    409409        if($end_y < 0) { 
     
    417417        PDF_delete_textflow($this->pdf, $tf); 
    418418         
    419         // ¥Æ¡¼¥Ö¥ëº¸²¼ºÂɸ¤òÊÖ¤¹ 
     419        // テーブル左下座標を返す 
    420420        return array($x, $y + $table_height);        
    421421    } 
    422422         
    423     // ¿§¤ÎÀßÄê 
     423    // 色の設定 
    424424    function setColor($rgb) { 
    425425        if($rgb != "") { 
     
    429429    } 
    430430     
    431     // û·Á¤òÉÁ²è 
     431    // 短形を描画 
    432432    function writeRect($x, $y, $width, $height, $rgb = "") { 
    433433        $this->openPage(); 
     
    438438    } 
    439439     
    440     // ÏÈÉÕ¤Îû·Á¤òÉÁ²è 
     440    // 枠付の短形を描画 
    441441    function writeFrameRect($x, $y, $width, $height, $rgb, $frgb) { 
    442442        $this->openPage(); 
     
    451451    } 
    452452     
    453     // ľÀþ¤òÉÁ²è 
     453    // 直線を描画 
    454454    function writeLine($sx, $sy, $ex, $ey, $rgb = "000000") { 
    455455        $this->openPage(); 
     
    463463    } 
    464464         
    465     // ¥Õ¥¡¥¤¥ë¤Î¥À¥¦¥ó¥í¡¼¥É 
     465    // ファイルのダウンロード 
    466466    function output($filekey = "") { 
    467467        if(isset($this->pdf)) { 
    468             // ¥Ú¡¼¥¸¤òÊĤ¸¤ë 
     468            // ページを閉じる 
    469469            $this->closePage(); 
    470             // PDF¤Î½ªÎ» 
     470            // PDFの終了 
    471471            PDF_end_document($this->pdf, NULL); 
    472             // ½ÐÎÏÍѥǡ¼¥¿¤Î¼èÆÀ  
     472            // 出力用データの取得  
    473473            $buf = PDF_get_buffer($this->pdf); 
    474474            $filename = $filekey . date("ymdHis").".pdf"; 
     
    478478                     
    479479            /* 
    480              * session_start()¤ò»öÁ°¤Ë¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¾ì¹ç¤Ë½ÐÎϤµ¤ì¤ë°Ê²¼¤Î¥Ø¥Ã¥À¤Ï¡¢ 
    481              * URLľÀܸƤӽФ·»þ¤Ë¥¨¥é¡¼¤òȯÀ¸¤µ¤»¤ë¤Î¤Ç¶õ¤Ë¤·¤Æ¤ª¤¯¡£ 
     480             * session_start()を事前に呼び出している場合に出力される以下のヘッダは、 
     481             * URL直接呼び出し時にエラーを発生させるので空にしておく。 
    482482             * 
    483483             * Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 
     
    489489            print $buf; 
    490490             
    491             // PDF²òÊü 
     491            // PDF解放 
    492492            PDF_delete($this->pdf); 
    493493        } else { 
    494             print("PDF¤¬À¸À®¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£"); 
     494            print("PDFが生成されていません。"); 
    495495        } 
    496496        exit;        
    497497    } 
    498498     
    499     // ¥Õ¥¡¥¤¥ë¤Îɽ¼¨ 
     499    // ファイルの表示 
    500500    function display() { 
    501501        if(isset($this->pdf)) { 
    502             // ¥Ú¡¼¥¸¤òÊĤ¸¤ë 
     502            // ページを閉じる 
    503503            $this->closePage(); 
    504             // PDF¤Î½ªÎ» 
     504            // PDFの終了 
    505505            PDF_end_document($this->pdf, NULL); 
    506506             
    507             // ½ÐÎÏÍѥǡ¼¥¿¤Î¼èÆÀ  
     507            // 出力用データの取得  
    508508            $buf = PDF_get_buffer($this->pdf); 
    509509            $len = strlen($buf); 
     
    513513                                 
    514514            /* 
    515              * session_start()¤ò»öÁ°¤Ë¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¾ì¹ç¤Ë½ÐÎϤµ¤ì¤ë°Ê²¼¤Î¥Ø¥Ã¥À¤Ï¡¢ 
    516              * URLľÀܸƤӽФ·»þ¤Ë¥¨¥é¡¼¤òȯÀ¸¤µ¤»¤ë¤Î¤Ç¶õ¤Ë¤·¤Æ¤ª¤¯¡£ 
     515             * session_start()を事前に呼び出している場合に出力される以下のヘッダは、 
     516             * URL直接呼び出し時にエラーを発生させるので空にしておく。 
    517517             * 
    518518             * Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 
     
    524524            print $buf; 
    525525             
    526             // PDF²òÊü 
     526            // PDF解放 
    527527            PDF_delete($this->pdf); 
    528528        } else { 
    529             print("PDF¤¬À¸À®¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£"); 
     529            print("PDFが生成されていません。"); 
    530530        } 
    531531        exit; 
Note: See TracChangeset for help on using the changeset viewer.