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


PHP TCPDF_STATIC::getBorderMode方法代码示例

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


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

示例1: drawHTMLTagBorder

 /**
  * Draw an HTML block border and fill
  * @param $tag (array) array of tag properties.
  * @param $xmax (int) end X coordinate for border.
  * @protected
  * @since 5.7.000 (2010-08-03)
  */
 protected function drawHTMLTagBorder($tag, $xmax)
 {
     if (!isset($tag['borderposition'])) {
         // nothing to draw
         return;
     }
     $prev_x = $this->x;
     $prev_y = $this->y;
     $prev_lasth = $this->lasth;
     $border = 0;
     $fill = false;
     $this->lasth = 0;
     if (isset($tag['border']) and !empty($tag['border'])) {
         // get border style
         $border = $tag['border'];
         if (!TCPDF_STATIC::empty_string($this->thead) and !$this->inthead) {
             // border for table header
             $border = TCPDF_STATIC::getBorderMode($border, $position = 'middle', $this->opencell);
         }
     }
     if (isset($tag['bgcolor']) and $tag['bgcolor'] !== false) {
         // get background color
         $old_bgcolor = $this->bgcolor;
         $this->SetFillColorArray($tag['bgcolor']);
         $fill = true;
     }
     if (!$border and !$fill) {
         // nothing to draw
         return;
     }
     if (isset($tag['attribute']['cellspacing'])) {
         $clsp = $this->getHTMLUnitToUnits($tag['attribute']['cellspacing'], 1, 'px');
         $cellspacing = array('H' => $clsp, 'V' => $clsp);
     } elseif (isset($tag['border-spacing'])) {
         $cellspacing = $tag['border-spacing'];
     } else {
         $cellspacing = array('H' => 0, 'V' => 0);
     }
     if ($tag['value'] != 'table' and is_array($border) and !empty($border)) {
         // draw the border externally respect the sqare edge.
         $border['mode'] = 'ext';
     }
     if ($this->rtl) {
         if ($xmax >= $tag['borderposition']['x']) {
             $xmax = $tag['borderposition']['xmax'];
         }
         $w = $tag['borderposition']['x'] - $xmax;
     } else {
         if ($xmax <= $tag['borderposition']['x']) {
             $xmax = $tag['borderposition']['xmax'];
         }
         $w = $xmax - $tag['borderposition']['x'];
     }
     if ($w <= 0) {
         return;
     }
     $w += $cellspacing['H'];
     $startpage = $tag['borderposition']['page'];
     $startcolumn = $tag['borderposition']['column'];
     $x = $tag['borderposition']['x'];
     $y = $tag['borderposition']['y'];
     $endpage = $this->page;
     $starty = $tag['borderposition']['y'] - $cellspacing['V'];
     $currentY = $this->y;
     $this->x = $x;
     // get latest column
     $endcolumn = $this->current_column;
     if ($this->num_columns == 0) {
         $this->num_columns = 1;
     }
     // get border modes
     $border_start = TCPDF_STATIC::getBorderMode($border, $position = 'start', $this->opencell);
     $border_end = TCPDF_STATIC::getBorderMode($border, $position = 'end', $this->opencell);
     $border_middle = TCPDF_STATIC::getBorderMode($border, $position = 'middle', $this->opencell);
     // temporary disable page regions
     $temp_page_regions = $this->page_regions;
     $this->page_regions = array();
     // design borders around HTML cells.
     for ($page = $startpage; $page <= $endpage; ++$page) {
         // for each page
         $ccode = '';
         $this->setPage($page);
         if ($this->num_columns < 2) {
             // single-column mode
             $this->x = $x;
             $this->y = $this->tMargin;
         }
         // account for margin changes
         if ($page > $startpage) {
             if ($this->rtl and $this->pagedim[$page]['orm'] != $this->pagedim[$startpage]['orm']) {
                 $this->x -= $this->pagedim[$page]['orm'] - $this->pagedim[$startpage]['orm'];
             } elseif (!$this->rtl and $this->pagedim[$page]['olm'] != $this->pagedim[$startpage]['olm']) {
                 $this->x += $this->pagedim[$page]['olm'] - $this->pagedim[$startpage]['olm'];
//.........这里部分代码省略.........
开发者ID:TheTypoMaster,项目名称:myapps,代码行数:101,代码来源:tcpdf.php


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