/* Print a series of receipts containing i18n example strings - Code below shouldn't need changing */
$printer = new Mike42\Escpos\Printer($connector, $profile);
$codePages = $profile->getCodePages();
$first = true;
// Print larger table for first code-page.
foreach ($codePages as $table => $page) {
/* Change printer code page */
$printer->selectCharacterTable(255);
$printer->selectCharacterTable($table);
/* Select & print a label for it */
$label = $page->getId();
if (!$page->isEncodable()) {
$label = " (not supported)";
}
$printer->setEmphasis(true);
$printer->textRaw("Table {$table}: {$label}\n");
$printer->setEmphasis(false);
if (!$page->isEncodable() && !$verbose) {
continue;
// Skip non-recognised
}
/* Print a table of available characters (first table is larger than subsequent ones */
if ($first) {
$first = false;
compactCharTable($printer, 1, true);
} else {
compactCharTable($printer);
}
}
$printer->cut();
$printer->close();