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

Public Member Functions

 flush ()
 
 getPrinter ()
 
 setPrinter (Printer $printer=null)
 
 writeText ($text)
 
 writeTextRaw ($text)
 
 setFont ($font)
 
 setFontSize ($fontSize)
 

Detailed Description

This class renders text to small images on-the-fly. It attempts to mimic the behaviour of text output, whilst supporting any fonts & character encodings which your system can handle. This class currently requires Imagick.

Member Function Documentation

Mike42\Escpos\PrintBuffers\ImagePrintBuffer::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\ImagePrintBuffer::getPrinter ( )

Used by Escpos to check if a printer is set.

Implements Mike42\Escpos\PrintBuffers\PrintBuffer.

Mike42\Escpos\PrintBuffers\ImagePrintBuffer::setFont (   $font)

Set path on disk to TTF font that will be used to render text to image, or 'null' to use a default.

ImageMagick will also accept a font name, but this will not port as well between systems.

Parameters
string$fontFont name or a filename
Mike42\Escpos\PrintBuffers\ImagePrintBuffer::setFontSize (   $fontSize)

Numeric font size for rendering text to image

Mike42\Escpos\PrintBuffers\ImagePrintBuffer::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\ImagePrintBuffer::writeText (   $text)

Accept UTF-8 text for printing.

Parameters
string$textText to print

Implements Mike42\Escpos\PrintBuffers\PrintBuffer.

Mike42\Escpos\PrintBuffers\ImagePrintBuffer::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.


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