当前位置: 首页>>代码示例>>PHP>>正文


PHP FPDI::getY方法代码示例

本文整理汇总了PHP中FPDI::getY方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDI::getY方法的具体用法?PHP FPDI::getY怎么用?PHP FPDI::getY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FPDI的用法示例。


在下文中一共展示了FPDI::getY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generatePDF


//.........这里部分代码省略.........
     $pdf->SetFont('Arial', 'B', 14);
     $pdf->Cell(60, 4, ucfirst($type_doc) . utf8_decode(_(' #')) . $facture->num_facture);
     $pdf->SetFont('Arial', '', 9);
     $pdf->SetXY(10, 27 + $logo_height);
     $pdf->Cell(60, 4, $societe->ville . " " . utf8_decode(_("on")) . " " . strftime("%d/%m/%Y", $facture->timestamp_date_facture));
     $pdf->SetXY(10, 32 + $logo_height);
     if (!empty($societe->tva_intracommunautaire)) {
         $pdf->Cell(60, 4, utf8_decode(_("VAT code")) . " " . $societe->raison_sociale . " : {$societe->tva_intracommunautaire}\n");
     }
     if (!empty($facture->vat_number)) {
         $pdf->Write(5, utf8_decode(_("Your VAT code")) . " : {$facture->vat_number}\n");
     }
     $pdf->Write(5, $facture->ref_contrat . "\n");
     $pdf->Write(5, wordwrap($facture->extra_top, 70));
     // Lignes de facturation
     $pdf->SetLineWidth(0.1);
     $pdf->SetXY(10, 80);
     $pdf->SetFont('Arial', 'B', '10');
     $pdf->Cell(110, 6, utf8_decode(_("Designation")), 1);
     $pdf->Cell(20, 6, utf8_decode(_("Quantity")), 1, 0, "C");
     $pdf->Cell(30, 6, utf8_decode(_("VAT excl.")), 1, 0, "C");
     $pdf->Cell(30, 6, utf8_decode(_("Total")), 1, 0, "C");
     $pdf->Ln();
     $total_ht = 0;
     foreach ($facture->lignes as $ligne) {
         foreach ($ligne as $n => $v) {
             $ligne->{$n} = preg_replace("/€/", "EUROSYMBOL", $ligne->{$n});
             $ligne->{$n} = utf8_decode($ligne->{$n});
             $ligne->{$n} = preg_replace("/EUROSYMBOL/", chr(128), $ligne->{$n});
         }
         setlocale(LC_TIME, "fr_FR.UTF8");
         // Replace dates like YYYY-MM-DD with nice expanded date
         $ligne->description = preg_replace_callback('/\\d{4}-\\d{2}-\\d{2}/', create_function('$matches', 'return utf8_decode(strftime("%e %B %Y", strtotime($matches[0])));'), $ligne->description);
         $y_start = $pdf->getY();
         $pdf->SetFont('Arial', '', '10');
         $pdf->MultiCell(110, 6, $ligne->description, "LR", 'L');
         $x = $pdf->getX();
         $y = $pdf->getY();
         $pdf->setXY(120, $y_start);
         $pdf->Cell(20, 6, $ligne->qtt, "LR", 0, "C");
         $pdf->Cell(30, 6, preg_replace("/\\./", ",", sprintf("%.2f" . EURO, $ligne->prix_ht)), "LR", 0, "R");
         $pdf->Cell(30, 6, preg_replace("/\\./", ",", sprintf("%.2f" . EURO, $ligne->prix_ht * $ligne->qtt)), "LR", 0, "R");
         $pdf->setXY(120, $y_start);
         $pdf->Cell(20, $y - $y_start, '', "LR", 0, "C");
         $pdf->Cell(30, $y - $y_start, '', "LR", 0, "R");
         $pdf->Cell(30, $y - $y_start, '', "LR", 0, "R");
         $total_ht += $ligne->prix_ht * $ligne->qtt;
         $pdf->Ln();
         $pdf->Cell(110, 2, "", "LR");
         $pdf->Cell(20, 2, "", "LR");
         $pdf->Cell(30, 2, "", "LR");
         $pdf->Cell(30, 2, "", "LR");
         $pdf->Ln();
     }
     $y_fin = $pdf->getY();
     if ($y < 190) {
         $pdf->Cell(110, 190 - $y, "", "LRB", 0, "C");
         $pdf->Cell(20, 190 - $y, "", "LRB", 0, "C");
         $pdf->Cell(30, 190 - $y, "", "LRB", 0, "C");
         $pdf->Cell(30, 190 - $y, "", "LRB", 0, "C");
         $pdf->Ln();
     }
     // Total HT
     $txt_type_paiement = $facture->type_paiement;
     if (preg_match('/eption de cette facture/', $txt_type_paiement) and $facture->language != 'fr_FR') {
         $txt_type_paiement = _('upon receipt of invoice');
开发者ID:lopacinski,项目名称:WebFinance,代码行数:67,代码来源:Facture.php


注:本文中的FPDI::getY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。