$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");
}