escpos-php
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
Mike42\Escpos\PrintBuffers\EscposPrintBuffer Class Reference
Inheritance diagram for Mike42\Escpos\PrintBuffers\EscposPrintBuffer:
Inheritance graph
[legend]
Collaboration diagram for Mike42\Escpos\PrintBuffers\EscposPrintBuffer:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 
 flush ()
 
 getPrinter ()
 
 setPrinter (Printer $printer=null)
 
 writeText ($text)
 
 writeTextRaw ($text)
 

Public Attributes

const COMPRESS_CACHE = true
 
const INPUT_ENCODING = "UTF-8"
 
const REPLACEMENT_CHAR = "?"
 

Detailed Description

This class manages newlines and character encoding for the target printer, and can be interchanged for an image-bassed buffer (ImagePrintBuffer) if you can't get it operating properly on your machine.

Constructor & Destructor Documentation

Mike42\Escpos\PrintBuffers\EscposPrintBuffer::__construct ( )

Empty print buffer.

Member Function Documentation

Mike42\Escpos\PrintBuffers\EscposPrintBuffer::flush ( )

Cause the buffer to send any partial input and wait on a newline. If the printer is already on a new line, this does nothing.

Implements Mike42\Escpos\PrintBuffers\PrintBuffer.

Mike42\Escpos\PrintBuffers\EscposPrintBuffer::getPrinter ( )

Used by Escpos to check if a printer is set.

Implements Mike42\Escpos\PrintBuffers\PrintBuffer.

Mike42\Escpos\PrintBuffers\EscposPrintBuffer::setPrinter ( Printer  $printer = null)

Used by Escpos to hook up one-to-one link between buffers and printers.

Parameters
Printer | null$printerNew printer

Implements Mike42\Escpos\PrintBuffers\PrintBuffer.

Mike42\Escpos\PrintBuffers\EscposPrintBuffer::writeText (   $text)

Accept UTF-8 text for printing.

Parameters
string$textText to print

Implements Mike42\Escpos\PrintBuffers\PrintBuffer.

Mike42\Escpos\PrintBuffers\EscposPrintBuffer::writeTextRaw (   $text)

Accept 8-bit text in the current encoding and add it to the buffer.

Parameters
string$textText to print, already the target encoding.

Implements Mike42\Escpos\PrintBuffers\PrintBuffer.

Member Data Documentation

const Mike42\Escpos\PrintBuffers\EscposPrintBuffer::COMPRESS_CACHE = true

True to cache output as .z, false to leave un-compressed (useful for debugging)

const Mike42\Escpos\PrintBuffers\EscposPrintBuffer::INPUT_ENCODING = "UTF-8"

The input encoding of the buffer.

const Mike42\Escpos\PrintBuffers\EscposPrintBuffer::REPLACEMENT_CHAR = "?"

Un-recognised characters will be replaced with this.


The documentation for this class was generated from the following file: