equal
deleted
inserted
replaced
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Barcode |
16 * @package Zend_Barcode |
17 * @subpackage Renderer |
17 * @subpackage Renderer |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: Pdf.php 24593 2012-01-05 20:35:02Z matthew $ |
20 * @version $Id$ |
21 */ |
21 */ |
22 |
22 |
23 /** @see Zend_Barcode_Renderer_RendererAbstract */ |
23 /** @see Zend_Barcode_Renderer_RendererAbstract */ |
24 require_once 'Zend/Barcode/Renderer/RendererAbstract.php'; |
24 require_once 'Zend/Barcode/Renderer/RendererAbstract.php'; |
25 |
25 |
35 /** |
35 /** |
36 * Class for rendering the barcode in PDF resource |
36 * Class for rendering the barcode in PDF resource |
37 * |
37 * |
38 * @category Zend |
38 * @category Zend |
39 * @package Zend_Barcode |
39 * @package Zend_Barcode |
40 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
40 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
41 * @license http://framework.zend.com/license/new-bsd New BSD License |
41 * @license http://framework.zend.com/license/new-bsd New BSD License |
42 */ |
42 */ |
43 class Zend_Barcode_Renderer_Pdf extends Zend_Barcode_Renderer_RendererAbstract |
43 class Zend_Barcode_Renderer_Pdf extends Zend_Barcode_Renderer_RendererAbstract |
44 { |
44 { |
45 /** |
45 /** |
60 */ |
60 */ |
61 protected $_moduleSize = 0.5; |
61 protected $_moduleSize = 0.5; |
62 |
62 |
63 /** |
63 /** |
64 * Set an image resource to draw the barcode inside |
64 * Set an image resource to draw the barcode inside |
65 * @param resource $value |
65 * |
|
66 * @param Zend_Pdf $pdf |
|
67 * @param int $page |
66 * @return Zend_Barcode_Renderer |
68 * @return Zend_Barcode_Renderer |
67 * @throw Zend_Barcode_Renderer_Exception |
69 * @throws Zend_Barcode_Renderer_Exception |
68 */ |
70 */ |
69 public function setResource($pdf, $page = 0) |
71 public function setResource($pdf, $page = 0) |
70 { |
72 { |
71 if (!$pdf instanceof Zend_Pdf) { |
73 if (!$pdf instanceof Zend_Pdf) { |
72 require_once 'Zend/Barcode/Renderer/Exception.php'; |
74 require_once 'Zend/Barcode/Renderer/Exception.php'; |
165 $page->drawPolygon($x, $y, $fillType); |
167 $page->drawPolygon($x, $y, $fillType); |
166 } |
168 } |
167 |
169 |
168 /** |
170 /** |
169 * Draw a text in the rendering resource |
171 * Draw a text in the rendering resource |
170 * @param string $text |
172 * |
171 * @param float $size |
173 * @param string $text |
172 * @param array $position |
174 * @param float $size |
173 * @param string $font |
175 * @param array $position |
174 * @param integer $color |
176 * @param string $font |
175 * @param string $alignment |
177 * @param integer $color |
176 * @param float $orientation |
178 * @param string $alignment |
|
179 * @param float|int $orientation |
177 */ |
180 */ |
178 protected function _drawText( |
181 protected function _drawText( |
179 $text, |
182 $text, |
180 $size, |
183 $size, |
181 $position, |
184 $position, |