$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"]); } if (isset($_REQUEST["headline_addition"])) { echo htmlspecialchars($_REQUEST["headline_addition"]); } echo "</td></tr></table>\n"; }
$barcode->setAutoAdjustFontSize(false); $barcode->saveBarcode('6.png'); echo "<h3>Not using auto adjusting font size</h3>"; echo "<p>setAutoAdjustFontSize set to false</p>"; echo '<pre> $barcode->setBorderWidth(2); $barcode->setBorderSpacing(10); $barcode->setPixelWidth(2); $barcode->setEanStyle(true); $barcode->setShowText(true); $barcode->setAutoAdjustFontSize(false); $barcode->setTextSpacing(5); </pre>'; echo "<img src='6.png'>"; echo "<hr />"; $barcode = new phpCode128('mikeleigh.com', 150, 'c:\\windows\\fonts\\verdana.ttf', 18); $barcode->setTextSpacing(20); $barcode->saveBarcode('7.png'); echo "<h3>Increase the text spacing</h3>"; echo "<p>setTextSpacing set to 20</p>"; echo '<pre> $barcode->setBorderWidth(2); $barcode->setBorderSpacing(10); $barcode->setPixelWidth(2); $barcode->setEanStyle(true); $barcode->setShowText(true); $barcode->setAutoAdjustFontSize(true); $barcode->setTextSpacing(20); </pre>'; echo "<img src='7.png'>"; echo "<hr />";