Beispiel #1
0
    $bits = str_pad(decbin($i), count($modes), "0", STR_PAD_LEFT);
    $mode = 0;
    for ($j = 0; $j < strlen($bits); $j++) {
        if (substr($bits, $j, 1) == "1") {
            $mode |= $modes[$j];
        }
    }
    $printer->selectPrintMode($mode);
    $printer->text("ABCDEFGHIJabcdefghijk\n");
}
$printer->selectPrintMode();
// Reset
$printer->cut();
/* Underline */
for ($i = 0; $i < 3; $i++) {
    $printer->setUnderline($i);
    $printer->text("The quick brown fox jumps over the lazy dog\n");
}
$printer->setUnderline(0);
// Reset
$printer->cut();
/* Cuts */
$printer->text("Partial cut\n(not available on all printers)\n");
$printer->cut(Escpos::CUT_PARTIAL);
$printer->text("Full cut\n");
$printer->cut(Escpos::CUT_FULL);
/* Emphasis */
for ($i = 0; $i < 2; $i++) {
    $printer->setEmphasis($i == 1);
    $printer->text("The quick brown fox jumps over the lazy dog\n");
}