PHP Class Mike42\Escpos\PrintBuffers\EscposPrintBuffer

Copyright (c) 2014-2015 Michael Billington , incorporating modifications by: - Roni Saha - Gergely Radics - Warren Doyle Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 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.
Inheritance: implements Mike42\Escpos\PrintBuffers\PrintBuffer
Show file Open project: mike42/escpos-php

Public Methods

Method Description
__construct ( ) Empty print buffer.
flush ( )
getPrinter ( )
setPrinter ( Printer $printer = null )
writeText ( $text )
writeTextRaw ( $text )

Private Methods

Method Description
asciiCheck ( string $char, boolean $extended = false ) : boolean Return true if a character is an ASCII printable character.
identifyText ( string $text ) : boolean | integer Return an encoding which we can start to use for outputting this text.
loadAvailableCharacters ( ) Based on the printer's connector, compute (or load a cached copy of) maps of UTF character to unicode characters for later use.
write ( string $data ) Write data to the underlying printer.
writeTextUsingEncoding ( string $text, integer $encodingNo ) Encode a block of text using the specified map, and write it to the printer.

Method Details

__construct() public method

Empty print buffer.
public __construct ( )

flush() public method

public flush ( )

getPrinter() public method

public getPrinter ( )

setPrinter() public method

public setPrinter ( Printer $printer = null )
$printer Mike42\Escpos\Printer

writeText() public method

public writeText ( $text )

writeTextRaw() public method

public writeTextRaw ( $text )