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


PHP pdf::setFont方法代码示例

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


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

示例1: render_content

 /**
  * Common behaviour for rendering specified content on the pdf.
  *
  * @param pdf $pdf the pdf object
  * @param string $content the content to render
  */
 public function render_content($pdf, $content)
 {
     list($font, $attr) = $this->get_font();
     $pdf->setFont($font, $attr, $this->element->size);
     $fontcolour = TCPDF_COLORS::convertHTMLColorToDec($this->element->colour, $fontcolour);
     $pdf->SetTextColor($fontcolour['R'], $fontcolour['G'], $fontcolour['B']);
     $x = $this->element->posx;
     $y = $this->element->posy;
     $w = $this->element->width;
     $align = $this->element->align;
     $refpoint = $this->element->refpoint;
     $actualwidth = $pdf->GetStringWidth($content);
     if ($w and $w < $actualwidth) {
         $actualwidth = $w;
     }
     switch ($refpoint) {
         case CUSTOMCERT_REF_POINT_TOPRIGHT:
             $x = $this->element->posx - $actualwidth;
             if ($x < 0) {
                 $x = 0;
                 $w = $this->element->posx;
             } else {
                 $w = $actualwidth;
             }
             break;
         case CUSTOMCERT_REF_POINT_TOPCENTER:
             $x = $this->element->posx - $actualwidth / 2;
             if ($x < 0) {
                 $x = 0;
                 $w = $this->element->posx * 2;
             } else {
                 $w = $actualwidth;
             }
             break;
     }
     if ($w) {
         $w += 0.0001;
     }
     $pdf->setCellPaddings(0, 0, 0, 0);
     $pdf->writeHTMLCell($w, 0, $x, $y, $content, 0, 0, false, true, $align);
 }
开发者ID:rezaies,项目名称:moodle-mod_customcert,代码行数:47,代码来源:element.class.php

示例2: in

 }
 if (isset($parReceit) and $parReceit != '') {
     $sqlReceit = "select distinct k02_descr from tabrec where k02_codigo in ({$parReceit})";
     //echo $sqlReceit;
     $rsRec = db_query($sqlReceit);
     $numRows = pg_num_rows($rsRec);
     $vRec = "";
     $legRec = '';
     if ($numRows > 0) {
         for ($i = 0; $i < $numRows; $i++) {
             db_FieldsMemory($rsRec, $i);
             $legRec .= $vRec . $k02_descr;
             $vRec = ', ';
         }
     }
     $pdf->setFont("Arial", '', 10);
     $pdf->ln();
     $pdf->multiCell(190, 4, "Receitas Selecionadas: {$legRec}");
 }
 $pdf->Ln();
 if (isset($matric)) {
     $sSqlInnerTabela = " inner join arrematric on arrematric.k00_numpre = arresusp.k00_numpre ";
     $sSqlWhereTabela = " arrematric.k00_matric = {$matric} ";
 } else {
     if (isset($inscr)) {
         $sSqlInnerTabela = " inner join arreinscr on arreinscr.k00_numpre = arresusp.k00_numpre ";
         $sSqlWhereTabela = " arreinscr.k00_inscr  = {$inscr} ";
     } else {
         if (isset($numcgm)) {
             $sSqlInnerTabela = " inner join arrenumcgm on arrenumcgm.k00_numpre = arresusp.k00_numpre ";
             $sSqlWhereTabela = " arrenumcgm.k00_numcgm = {$numcgm} ";
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:31,代码来源:cai3_gerfinanc011.php


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