Mike42\Escpos\Printer::setBarcodeHeight PHP Метод

setBarcodeHeight() публичный Метод

Set barcode height.
public setBarcodeHeight ( integer $height = 8 )
$height integer Height in dots. If not specified, 8 will be used.
    public function setBarcodeHeight($height = 8)
    {
        self::validateInteger($height, 1, 255, __FUNCTION__);
        $this->connector->write(self::GS . "h" . chr($height));
    }

Usage Example

Пример #1
0
    $printer->text("The quick brown fox jumps over the lazy dog\n");
}
$printer->setFont();
// Reset
$printer->cut();
/* Justification */
$justification = array(Printer::JUSTIFY_LEFT, Printer::JUSTIFY_CENTER, Printer::JUSTIFY_RIGHT);
for ($i = 0; $i < count($justification); $i++) {
    $printer->setJustification($justification[$i]);
    $printer->text("A man a plan a canal panama\n");
}
$printer->setJustification();
// Reset
$printer->cut();
/* Barcodes - see barcode.php for more detail */
$printer->setBarcodeHeight(80);
$printer->setBarcodeTextPosition(Printer::BARCODE_TEXT_BELOW);
$printer->barcode("9876");
$printer->feed();
$printer->cut();
/* Graphics - this demo will not work on some non-Epson printers */
try {
    $logo = EscposImage::load("resources/escpos-php.png", false);
    $imgModes = array(Printer::IMG_DEFAULT, Printer::IMG_DOUBLE_WIDTH, Printer::IMG_DOUBLE_HEIGHT, Printer::IMG_DOUBLE_WIDTH | Printer::IMG_DOUBLE_HEIGHT);
    foreach ($imgModes as $mode) {
        $printer->graphics($logo, $mode);
    }
} catch (Exception $e) {
    /* Images not supported on your PHP, or image file not found */
    $printer->text($e->getMessage() . "\n");
}
All Usage Examples Of Mike42\Escpos\Printer::setBarcodeHeight