getPrintConnector()->write($barcodeCommand); $printer->cut(); $printer->close(); /** * Generate two characters for a number: In lower and higher parts, or more parts as needed. * * @param int $input * Input number * @param int $length * The number of bytes to output (1 - 4). */ function intLowHigh($input, $length) { $outp = ""; for ($i = 0; $i < $length; $i++) { $outp .= chr($input % 256); $input = (int) ($input / 256); } return $outp; }