escpos-php
Public Member Functions | Public Attributes | List of all members
Mike42\Escpos\PrintBuffers\EscposPrintBuffer Class Reference

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. More...

Inheritance diagram for Mike42\Escpos\PrintBuffers\EscposPrintBuffer:
Inheritance graph
[legend]
Collaboration diagram for Mike42\Escpos\PrintBuffers\EscposPrintBuffer:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 Empty print buffer.
 
 flush ()
 Cause the buffer to send any partial input and wait on a newline. More...
 
 getPrinter ()
 Used by Escpos to check if a printer is set.
 
 setPrinter (Printer $printer=null)
 Used by Escpos to hook up one-to-one link between buffers and printers. More...
 
 writeText (string $text)
 Accept UTF-8 text for printing. More...
 
 writeTextRaw (string $text)
 Accept 8-bit text in the current encoding and add it to the buffer. More...
 

Public Attributes

const COMPRESS_CACHE = true
 True to cache output as .z, false to leave un-compressed (useful for debugging)
 
const REPLACEMENT_CHAR = "?"
 Un-recognised characters will be replaced with this.
 

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.

Member Function Documentation

◆ flush()

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.

◆ setPrinter()

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.

◆ writeText()

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

Accept UTF-8 text for printing.

Parameters
string$textText to print

Implements Mike42\Escpos\PrintBuffers\PrintBuffer.

◆ writeTextRaw()

Mike42\Escpos\PrintBuffers\EscposPrintBuffer::writeTextRaw ( string  $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.


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