Mike42\Escpos\Printer::textRaw PHP Method

textRaw() public method

Text should either be followed by a line-break, or feed() should be called after this to clear the print buffer.
public textRaw ( string $str = "" )
$str string Text to print
    public function textRaw($str = "")
    {
        self::validateString($str, __FUNCTION__);
        $this->buffer->writeTextRaw((string) $str);
    }

Usage Example

Example #1
0
/* 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();