示例#1
0
文件: Widows.php 项目: voilab/tctable
 private function resetPageBreakTrigger()
 {
     // pagebreak trigger adaptation
     if ($this->table) {
         $this->pageBreakTrigger = $this->table->getPdF()->getPageHeight() - $this->table->getPdf()->getBreakMargin() - $this->footerHeight;
     }
 }
示例#2
0
 /**
  * Get the remaining width available, taking into account margins and
  * other cells width or the specified maxwidth if any.
  *
  * @param TcTable $table
  * @param array|float $width sum of all other cells width
  * @return float
  */
 private function getRemainingColumnWidth(TcTable $table, $width)
 {
     if (!$this->maxWidth) {
         $margins = $table->getPdf()->getMargins();
         $content_width = $table->getPdf()->getPageWidth() - $margins['left'] - $margins['right'];
     } else {
         $content_width = $this->maxWidth;
     }
     $result = $content_width - (is_array($width) ? array_sum($width) : $width);
     return $result > 0 ? $result : 0;
 }
示例#3
0
 /**
  * Adjust Y because cell background passes over the previous cell's border,
  * hiding it.
  *
  * @param TcTable $table
  */
 public function moveY(TcTable $table)
 {
     $y = 0.6 / $table->getPdf()->getScaleFactor();
     $table->getPdf()->SetY($table->getPdf()->GetY() + $y);
 }
示例#4
0
文件: Debug.php 项目: voilab/tctable
 /**
  * {@inheritDocs}
  */
 public function configure(TcTable $table)
 {
     $table->on(TcTable::EV_COLUMN_ADDED, [$this, 'columnAdded'])->on(TcTable::EV_BODY_ADD, [$this, 'bodyAdd'])->on(TcTable::EV_BODY_ADDED, [$this, 'bodyAdded'])->on(TcTable::EV_BODY_SKIPPED, [$this, 'bodySkipped'])->on(TcTable::EV_HEADER_ADD, [$this, 'headerAdd'])->on(TcTable::EV_HEADER_ADDED, [$this, 'headerAdded'])->on(TcTable::EV_PAGE_ADD, [$this, 'pageAdd'])->on(TcTable::EV_PAGE_ADDED, [$this, 'pageAdded'])->on(TcTable::EV_ROW_ADD, [$this, 'rowAdd'])->on(TcTable::EV_ROW_ADDED, [$this, 'rowAdded'])->on(TcTable::EV_ROW_SKIPPED, [$this, 'rowSkipped'])->on(TcTable::EV_ROW_HEIGHT_GET, [$this, 'rowHeightGet'])->on(TcTable::EV_CELL_ADD, [$this, 'cellAdd'])->on(TcTable::EV_CELL_ADDED, [$this, 'cellAdded'])->on(TcTable::EV_CELL_HEIGHT_GET, [$this, 'cellHeightGet']);
 }