Colorized “barcode_svg.php”

You can download the original file here: barcode_svg.php

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<?php

require_once("./Code39.php");

$code = /* isset($_GET['code']) ? $_GET['code'] : */ 'GREYWORLD.NET';
$height = /* isset($_GET['height']) ? $_GET['height'] : */ 1.5;
$units = /* isset($_GET['units']) ? $_GET['units'] : */ 'cm';
$pixh = /* isset($_GET['pixh']) ? $_GET['pixh'] : */ 40;
$fnth = /* isset($_GET['fnth']) ? $_GET['fnth'] : */ 10;

$bc = new Code39();
list($width, $img) = $bc->render($code, $height, $units, $pixh, $fnth);

header("Content-type: image/svg+xml");
echo implode("\n", $img);