if ($myrow = mysql_fetch_array($result_headline)) { echo $myrow[0]; echo "</td></tr>"; if (isset($show_summary_barcode) and $show_summary_barcode === TRUE) { // include_once 'lib\\barcode\\code128.class.php'; $thistext = htmlspecialchars($myrow[0]); // // FIXME: (AJH) The font could be an issue, as we have no idea where the fonts reside. // If windows, the above should work, if Linux, anything might happen. // I should fix this by standardising this and the disk usage font, or including a local font. // $thisfont = 'c:\\windows\\fonts\\verdana.ttf'; $thisimagename = 'barcode.png'; $barcode = new phpCode128($thistext, 120, $thisfont, 18); $barcode->setBorderWidth(1); $barcode->setBorderSpacing(10); $barcode->setPixelWidth(1); $barcode->setEanStyle(true); $barcode->setShowText(true); $barcode->setAutoAdjustFontSize(true); $barcode->setTextSpacing(5); // $barcode->setEanStyle(false); // $barcode->setShowText(true); $barcode->saveBarcode($thisimagename); echo "<img src='" . $thisimagename . "'><tr>"; // } } } else { echo htmlspecialchars($query_array["name"]);
$barcode->saveBarcode('1.png'); echo "<h3>Using the default class</h3>"; echo "<p>Font is set to verdanna with size 18 and the image size to 150. The following defautls are used. These are the same as the class defaults</p>"; echo '<pre> $barcode->setBorderWidth(2); $barcode->setBorderSpacing(10); $barcode->setPixelWidth(1); $barcode->setEanStyle(true); $barcode->setShowText(true); $barcode->setAutoAdjustFontSize(true); $barcode->setTextSpacing(5); </pre>'; echo "<img src='1.png'>"; echo "<hr />"; $barcode = new phpCode128('mikeleigh.com', 150, 'c:\\windows\\fonts\\verdana.ttf', 18); $barcode->setBorderWidth(0); $barcode->setBorderSpacing(0); $barcode->saveBarcode('2.png'); echo "<h3>Removing the border</h3>"; echo "<p>setBorderWidth and setBorderSpacing set to 0</p>"; echo '<pre> $barcode->setBorderWidth(0); $barcode->setBorderSpacing(0); $barcode->setPixelWidth(1); $barcode->setEanStyle(true); $barcode->setShowText(true); $barcode->setAutoAdjustFontSize(true); $barcode->setTextSpacing(5); </pre>'; echo "<img src='2.png'>"; echo "<hr />";