Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
add page_line() method (dompdf#1702)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrille37 authored and bsweeney committed Jul 10, 2018
1 parent d17364e commit 9669707
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Adapter/PDFLib.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,25 @@ public function line($x1, $y1, $x2, $y2, $color, $width, $style = null)
$this->_set_line_transparency("Normal", $this->_current_opacity);
}

/**
* Draw line at the specified coordinates on every page.
*
* See {@link Style::munge_color()} for the format of the colour array.
*
* @param float $x1
* @param float $y1
* @param float $x2
* @param float $y2
* @param array $color
* @param float $width
* @param array $style optional
*/
public function page_line($x1, $y1, $x2, $y2, $color, $width, $style = array())
{
$_t = 'line';
$this->_page_text[] = compact('_t', 'x1', 'y1', 'x2', 'y2', 'color', 'width', 'style');
}

/**
* @param float $x1
* @param float $y1
Expand Down Expand Up @@ -1259,6 +1278,11 @@ protected function _add_page_text()
}
$eval->evaluate($code, array('PAGE_NUM' => $p, 'PAGE_COUNT' => $this->_page_count));
break;

case 'line':
$this->line( $x1, $y1, $x2, $y2, $color, $width, $style );
break;

}
}

Expand Down

0 comments on commit 9669707

Please sign in to comment.