@@ 93-104 (lines=12) @@ | ||
90 | * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). |
|
91 | * @public |
|
92 | */ |
|
93 | public function getBarcodeSVG($w=2, $h=30, $color='black') { |
|
94 | // send headers |
|
95 | $code = $this->getBarcodeSVGcode($w, $h, $color); |
|
96 | header('Content-Type: application/svg+xml'); |
|
97 | header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 |
|
98 | header('Pragma: public'); |
|
99 | header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past |
|
100 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
101 | header('Content-Disposition: inline; filename="'.md5($code).'.svg";'); |
|
102 | //header('Content-Length: '.strlen($code)); |
|
103 | echo $code; |
|
104 | } |
|
105 | ||
106 | /** |
|
107 | * Return a SVG string representation of barcode. |
@@ 87-98 (lines=12) @@ | ||
84 | * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). |
|
85 | * @public |
|
86 | */ |
|
87 | public function getBarcodeSVG($w=3, $h=3, $color='black') { |
|
88 | // send headers |
|
89 | $code = $this->getBarcodeSVGcode($w, $h, $color); |
|
90 | header('Content-Type: application/svg+xml'); |
|
91 | header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 |
|
92 | header('Pragma: public'); |
|
93 | header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past |
|
94 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
95 | header('Content-Disposition: inline; filename="'.md5($code).'.svg";'); |
|
96 | //header('Content-Length: '.strlen($code)); |
|
97 | echo $code; |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * Return a SVG string representation of barcode. |