| escpos-php

- Main Page
- Related Pages
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
Mike42\Escpos\PrintBuffers\PrintBuffer Interface Reference
Inheritance diagram for Mike42\Escpos\PrintBuffers\PrintBuffer:
[legend]

## Public Member Functions
| flush ()
| getPrinter ()
| setPrinter (Printer $printer=null)
| writeText ($text)
| writeTextRaw ($text)

## Detailed Description

Print buffers manage newlines and character encoding for the target printer. They are used as a swappable component: text or image-based output.

- Text output (EscposPrintBuffer) is the fast default, and is recommended for most people, as the text output can be more directly manipulated by ESC/POS commands.
- Image output (ImagePrintBuffer) is designed to accept more encodings than the physical printer supports, by rendering the text to small images on-the-fly. This takes a lot more CPU than sending text, but is necessary for some users.
- If your use case fits outside these, then a further speed/flexibility trade-off can be made by printing directly from generated HTML or PDF.

## Member Function Documentation

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

Implemented in Mike42\Escpos\PrintBuffers\EscposPrintBuffer, and Mike42\Escpos\PrintBuffers\ImagePrintBuffer.

Mike42\Escpos\PrintBuffers\PrintBuffer::getPrinter | ( |  | ) |

Used by Escpos to check if a printer is set.

Implemented in Mike42\Escpos\PrintBuffers\EscposPrintBuffer, and Mike42\Escpos\PrintBuffers\ImagePrintBuffer.

Mike42\Escpos\PrintBuffers\PrintBuffer::setPrinter | ( | Printer | $printer = `null` | ) |

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

Parameters

  Printer | null | $printer | New printer

Implemented in Mike42\Escpos\PrintBuffers\EscposPrintBuffer, and Mike42\Escpos\PrintBuffers\ImagePrintBuffer.

Mike42\Escpos\PrintBuffers\PrintBuffer::writeText | ( |  | $text | ) |

Accept UTF-8 text for printing.

Parameters

  string | $text | Text to print

Implemented in Mike42\Escpos\PrintBuffers\EscposPrintBuffer, and Mike42\Escpos\PrintBuffers\ImagePrintBuffer.

Mike42\Escpos\PrintBuffers\PrintBuffer::writeTextRaw | ( |  | $text | ) |

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

Parameters

  string | $text | Text to print, already the target encoding.

Implemented in Mike42\Escpos\PrintBuffers\EscposPrintBuffer, and Mike42\Escpos\PrintBuffers\ImagePrintBuffer.

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

- C:/www/aplusnet/incahellas.com/public_html/lib/escpos-php-development/src/Mike42/Escpos/PrintBuffers/PrintBuffer.php