Changeset 21358 for branches/version-2_11-dev
- Timestamp:
- 2011/11/26 16:48:07 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/class/SC_Fpdf.php
r21316 r21358 32 32 define('PDF_TEMPLATE_REALDIR', TEMPLATE_ADMIN_REALDIR . 'pdf/'); 33 33 34 class SC_Fpdf {34 class SC_Fpdf extends PDF_Japanese { 35 35 function SC_Fpdf($download, $title, $tpl_pdf = 'nouhinsyo1.pdf') { 36 $this->FPDF(); 36 37 // デフォルトの設定 37 38 $this->tpl_pdf = PDF_TEMPLATE_REALDIR . $tpl_pdf; // テンプレートファイル … … 54 55 ); 55 56 56 $this->pdf = new PDF_Japanese();57 57 $this->lfAddGothicFont(); 58 58 59 59 // SJISフォント 60 $this-> pdf->AddSJISFont();61 $this-> pdf->SetFont('SJIS');60 $this->AddSJISFont(); 61 $this->SetFont('SJIS'); 62 62 63 63 //ページ総数取得 64 $this-> pdf->AliasNbPages();64 $this->AliasNbPages(); 65 65 66 66 // マージン設定 67 $this-> pdf->SetMargins(15, 20);67 $this->SetMargins(15, 20); 68 68 69 69 // PDFを読み込んでページ数を取得 70 $pageno = $this-> pdf->setSourceFile($this->tpl_pdf);70 $pageno = $this->setSourceFile($this->tpl_pdf); 71 71 } 72 72 … … 75 75 76 76 // ページ番号よりIDを取得 77 $tplidx = $this-> pdf->ImportPage(1);77 $tplidx = $this->ImportPage(1); 78 78 79 79 // ページを追加(新規) 80 $this-> pdf->AddPage();80 $this->AddPage(); 81 81 82 82 //表示倍率(100%) 83 $this-> pdf->SetDisplayMode($this->tpl_dispmode);83 $this->SetDisplayMode($this->tpl_dispmode); 84 84 85 85 if (SC_Utils_Ex::sfIsInt($arrData['order_id'])) { … … 89 89 90 90 // テンプレート内容の位置、幅を調整 ※useTemplateに引数を与えなければ100%表示がデフォルト 91 $this-> pdf->useTemplate($tplidx);91 $this->useTemplate($tplidx); 92 92 93 93 $this->setShopData(); … … 127 127 //ロゴ画像 128 128 $logo_file = PDF_TEMPLATE_REALDIR . 'logo.png'; 129 $this-> pdf->Image($logo_file, 124, 46, 40);129 $this->Image($logo_file, 124, 46, 40); 130 130 } 131 131 … … 153 153 154 154 // お届け先情報 155 $this-> pdf->SetFont('SJIS', '', 10);155 $this->SetFont('SJIS', '', 10); 156 156 $this->lfText(25, 125, SC_Utils_Ex::sfDispDBDate($this->arrDisp['create_date']), 10); //ご注文日 157 157 $this->lfText(25, 135, $this->arrDisp['order_id'], 10); //注文番号 158 158 159 $this-> pdf->SetFont('Gothic', 'B', 15);160 $this-> pdf->Cell(0, 10, $this->lfConvSjis($this->tpl_title), 0, 2, 'C', 0, ''); //文書タイトル(納品書・請求書)161 $this-> pdf->Cell(0, 66, '', 0, 2, 'R', 0, '');162 $this-> pdf->Cell(5, 0, '', 0, 0, 'R', 0, '');163 $this-> pdf->SetFont('SJIS', 'B', 15);164 $this-> pdf->Cell(67, 8, $this->lfConvSjis(number_format($this->arrDisp['payment_total'])." 円"), 0, 2, 'R', 0, '');165 $this-> pdf->Cell(0, 45, '', 0, 2, '', 0, '');166 167 $this-> pdf->SetFont('SJIS', '', 8);159 $this->SetFont('Gothic', 'B', 15); 160 $this->Cell(0, 10, $this->lfConvSjis($this->tpl_title), 0, 2, 'C', 0, ''); //文書タイトル(納品書・請求書) 161 $this->Cell(0, 66, '', 0, 2, 'R', 0, ''); 162 $this->Cell(5, 0, '', 0, 0, 'R', 0, ''); 163 $this->SetFont('SJIS', 'B', 15); 164 $this->Cell(67, 8, $this->lfConvSjis(number_format($this->arrDisp['payment_total'])." 円"), 0, 2, 'R', 0, ''); 165 $this->Cell(0, 45, '', 0, 2, '', 0, ''); 166 167 $this->SetFont('SJIS', '', 8); 168 168 169 169 $monetary_unit = $this->lfConvSjis("円"); … … 254 254 } 255 255 256 $this-> pdf->FancyTable($this->label_cell, $arrOrder, $this->width_cell);256 $this->FancyTable($this->label_cell, $arrOrder, $this->width_cell); 257 257 } 258 258 259 259 function setEtcData() { 260 $this-> pdf->Cell(0, 10, '', 0, 1, 'C', 0, '');261 $this-> pdf->SetFont('Gothic', 'B', 9);262 $this-> pdf->MultiCell(0, 6, $this->lfConvSjis("< 備 考 >"), 'T', 2, 'L', 0, ''); //備考263 $this-> pdf->Ln();264 $this-> pdf->SetFont('SJIS', '', 8);265 $this-> pdf->MultiCell(0, 4, $this->lfConvSjis($this->arrData['etc1']."\n".$this->arrData['etc2']."\n".$this->arrData['etc3']), '', 2, 'L', 0, ''); //備考260 $this->Cell(0, 10, '', 0, 1, 'C', 0, ''); 261 $this->SetFont('Gothic', 'B', 9); 262 $this->MultiCell(0, 6, $this->lfConvSjis("< 備 考 >"), 'T', 2, 'L', 0, ''); //備考 263 $this->Ln(); 264 $this->SetFont('SJIS', '', 8); 265 $this->MultiCell(0, 4, $this->lfConvSjis($this->arrData['etc1']."\n".$this->arrData['etc2']."\n".$this->arrData['etc3']), '', 2, 'L', 0, ''); //備考 266 266 } 267 267 … … 270 270 ob_clean(); 271 271 if ($this->pdf_download == 1) { 272 if ($this-> pdf->PageNo() == 1) {272 if ($this->PageNo() == 1) { 273 273 $filename = "nouhinsyo-No".$this->arrData['order_id'].".pdf"; 274 274 } else { 275 275 $filename = "nouhinsyo.pdf"; 276 276 } 277 $this-> pdf->Output($this->lfConvSjis($filename), 'D');277 $this->Output($this->lfConvSjis($filename), 'D'); 278 278 } else { 279 $this-> pdf->Output();279 $this->Output(); 280 280 } 281 281 282 282 // 入力してPDFファイルを閉じる 283 $this-> pdf->Close();283 $this->Close(); 284 284 } 285 285 … … 287 287 function lfText($x, $y, $text, $size = 0, $style = '') { 288 288 // 退避 289 $bak_font_style = $this-> pdf->FontStyle;290 $bak_font_size = $this-> pdf->FontSizePt;291 292 $this-> pdf->SetFont('', $style, $size);293 $this-> pdf->Text($x, $y, $this->lfConvSjis($text));289 $bak_font_style = $this->FontStyle; 290 $bak_font_size = $this->FontSizePt; 291 292 $this->SetFont('', $style, $size); 293 $this->Text($x, $y, $this->lfConvSjis($text)); 294 294 295 295 // 復元 296 $this-> pdf->SetFont('', $bak_font_style, $bak_font_size);296 $this->SetFont('', $bak_font_style, $bak_font_size); 297 297 } 298 298 … … 343 343 $c_map = '90msp-RKSJ-H'; 344 344 $registry = array('ordering'=>'Japan1','supplement'=>2); 345 $this->pdf->AddCIDFonts('Gothic', 'KozGoPro-Medium-Acro,MS-PGothic,Osaka', $cw, $c_map, $registry); 345 $this->AddCIDFonts('Gothic', 'KozGoPro-Medium-Acro,MS-PGothic,Osaka', $cw, $c_map, $registry); 346 } 347 348 /** 349 * フッター 350 * 351 * 現状の PDF_Japanese#Footer の動作によって、生成される PDF がエラーとなるケースがあり、 352 * そのエラーを抑える意図。 353 * @return void 354 */ 355 function Footer() { 346 356 } 347 357 }
Note: See TracChangeset
for help on using the changeset viewer.