From 966970779c0b5fe30652eeb29debc0c06c975937 Mon Sep 17 00:00:00 2001 From: Cyrille Giquello Date: Mon, 2 Apr 2018 08:16:26 +0200 Subject: [PATCH] add page_line() method (#1702) --- src/Adapter/PDFLib.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Adapter/PDFLib.php b/src/Adapter/PDFLib.php index d002754fd..42d079f8c 100644 --- a/src/Adapter/PDFLib.php +++ b/src/Adapter/PDFLib.php @@ -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 @@ -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; + } }