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

Public Member Functions

 __construct (PrintConnector $connector, CapabilityProfile $profile=null)
 
 barcode ($content, $type=Printer::BARCODE_CODE39)
 
 bitImage (EscposImage $img, $size=Printer::IMG_DEFAULT)
 
 bitImageColumnFormat (EscposImage $img, $size=Printer::IMG_DEFAULT)
 
 close ()
 
 cut ($mode=Printer::CUT_FULL, $lines=3)
 
 feed ($lines=1)
 
 feedForm ()
 
 release ()
 
 feedReverse ($lines=1)
 
 getCharacterTable ()
 
 getPrintBuffer ()
 
 getPrintConnector ()
 
 getPrinterCapabilityProfile ()
 
 graphics (EscposImage $img, $size=Printer::IMG_DEFAULT)
 
 initialize ()
 
 pdf417Code ($content, $width=3, $heightMultiplier=3, $dataColumnCount=0, $ec=0.10, $options=Printer::PDF417_STANDARD)
 
 pulse ($pin=0, $on_ms=120, $off_ms=240)
 
 qrCode ($content, $ec=Printer::QR_ECLEVEL_L, $size=3, $model=Printer::QR_MODEL_2)
 
 selectCharacterTable ($table=0)
 
 selectPrintMode ($mode=Printer::MODE_FONT_A)
 
 setBarcodeHeight ($height=8)
 
 setBarcodeWidth ($width=3)
 
 setBarcodeTextPosition ($position=Printer::BARCODE_TEXT_NONE)
 
 setDoubleStrike ($on=true)
 
 setColor ($color=Printer::COLOR_1)
 
 setEmphasis ($on=true)
 
 setFont ($font=Printer::FONT_A)
 
 setJustification ($justification=Printer::JUSTIFY_LEFT)
 
 setLineSpacing ($height=null)
 
 setPrintLeftMargin ($margin=0)
 
 setPrintWidth ($width=512)
 
 setPrintBuffer (PrintBuffer $buffer)
 
 setReverseColors ($on=true)
 
 setTextSize ($widthMultiplier, $heightMultiplier)
 
 setUnderline ($underline=Printer::UNDERLINE_SINGLE)
 
 setUpsideDown ($on=true)
 
 text ($str="")
 
 textChinese ($str="")
 
 textRaw ($str="")
 

Public Attributes

const NUL = "\x00"
 
const LF = "\x0a"
 
const ESC = "\x1b"
 
const FS = "\x1c"
 
const FF = "\x0c"
 
const GS = "\x1d"
 
const DLE = "\x10"
 
const EOT = "\x04"
 
const BARCODE_UPCA = 65
 
const BARCODE_UPCE = 66
 
const BARCODE_JAN13 = 67
 
const BARCODE_JAN8 = 68
 
const BARCODE_CODE39 = 69
 
const BARCODE_ITF = 70
 
const BARCODE_CODABAR = 71
 
const BARCODE_CODE93 = 72
 
const BARCODE_CODE128 = 73
 
const BARCODE_TEXT_NONE = 0
 
const BARCODE_TEXT_ABOVE = 1
 
const BARCODE_TEXT_BELOW = 2
 
const COLOR_1 = 0
 
const COLOR_2 = 1
 
const CUT_FULL = 65
 
const CUT_PARTIAL = 66
 
const FONT_A = 0
 
const FONT_B = 1
 
const FONT_C = 2
 
const IMG_DEFAULT = 0
 
const IMG_DOUBLE_WIDTH = 1
 
const IMG_DOUBLE_HEIGHT = 2
 
const JUSTIFY_LEFT = 0
 
const JUSTIFY_CENTER = 1
 
const JUSTIFY_RIGHT = 2
 
const MODE_FONT_A = 0
 
const MODE_FONT_B = 1
 
const MODE_EMPHASIZED = 8
 
const MODE_DOUBLE_HEIGHT = 16
 
const MODE_DOUBLE_WIDTH = 32
 
const MODE_UNDERLINE = 128
 
const PDF417_STANDARD = 0
 
const PDF417_TRUNCATED = 1
 
const QR_ECLEVEL_L = 0
 
const QR_ECLEVEL_M = 1
 
const QR_ECLEVEL_Q = 2
 
const QR_ECLEVEL_H = 3
 
const QR_MODEL_1 = 1
 
const QR_MODEL_2 = 2
 
const QR_MICRO = 3
 
const STATUS_PRINTER = 1
 
const STATUS_OFFLINE_CAUSE = 2
 
const STATUS_ERROR_CAUSE = 3
 
const STATUS_PAPER_ROLL = 4
 
const STATUS_INK_A = 7
 
const STATUS_INK_B = 6
 
const STATUS_PEELER = 8
 
const UNDERLINE_NONE = 0
 
const UNDERLINE_SINGLE = 1
 
const UNDERLINE_DOUBLE = 2
 

Protected Member Functions

 wrapperSend2dCodeData ($fn, $cn, $data= '', $m= '')
 
 wrapperSendGraphicsData ($m, $fn, $data= '')
 

Static Protected Member Functions

static dataHeader (array $inputs, $long=true)
 
static intLowHigh ($input, $length)
 
static validateBoolean ($test, $source)
 
static validateFloat ($test, $min, $max, $source, $argument="Argument")
 
static validateInteger ($test, $min, $max, $source, $argument="Argument")
 
static validateIntegerMulti ($test, array $ranges, $source, $argument="Argument")
 
static validateString ($test, $source, $argument="Argument")
 
static validateStringRegex ($test, $source, $regex, $argument="Argument")
 

Protected Attributes

 $buffer
 
 $connector
 
 $profile
 
 $characterTable
 

Detailed Description

Main class for ESC/POS code generation

Constructor & Destructor Documentation

Mike42\Escpos\Printer::__construct ( PrintConnector  $connector,
CapabilityProfile  $profile = null 
)

Construct a new print object

Parameters
PrintConnector$connectorThe PrintConnector to send data to. If not set, output is sent to standard output.
CapabilityProfile | null$profileSupported features of this printer. If not set, the "default" CapabilityProfile will be used, which is suitable for Epson printers.
Exceptions
InvalidArgumentException

Member Function Documentation

Mike42\Escpos\Printer::barcode (   $content,
  $type = Printer::BARCODE_CODE39 
)

Print a barcode.

Parameters
string$contentThe information to encode.
int$typeThe barcode standard to output. Supported values are Printer::BARCODE_UPCA, Printer::BARCODE_UPCE, Printer::BARCODE_JAN13, Printer::BARCODE_JAN8, Printer::BARCODE_CODE39, Printer::BARCODE_ITF, Printer::BARCODE_CODABAR, Printer::BARCODE_CODE93, and Printer::BARCODE_CODE128. If not specified, Printer::BARCODE_CODE39 will be used. Note that some barcode formats only support specific lengths or sets of characters, and that available barcode types vary between printers.
Exceptions
InvalidArgumentExceptionWhere the length or characters used in $content is invalid for the requested barcode format.
Mike42\Escpos\Printer::bitImage ( EscposImage  $img,
  $size = Printer::IMG_DEFAULT 
)

Print an image, using the older "bit image" command. This creates padding on the right of the image, if its width is not divisible by 8.

Should only be used if your printer does not support the graphics() command. See also bitImageColumnFormat().

Parameters
EscposImage$imgThe image to print
int$sizeSize modifier for the image. Must be either Printer::IMG_DEFAULT (default), or any combination of the Printer::IMG_DOUBLE_HEIGHT and Printer::IMG_DOUBLE_WIDTH flags.
Mike42\Escpos\Printer::bitImageColumnFormat ( EscposImage  $img,
  $size = Printer::IMG_DEFAULT 
)

Print an image, using the older "bit image" command in column format.

Should only be used if your printer does not support the graphics() or bitImage() commands.

Parameters
EscposImage$imgThe image to print
int$sizeSize modifier for the image. Must be either Printer::IMG_DEFAULT (default), or any combination of the Printer::IMG_DOUBLE_HEIGHT and Printer::IMG_DOUBLE_WIDTH flags.
Mike42\Escpos\Printer::close ( )

Close the underlying buffer. With some connectors, the job will not actually be sent to the printer until this is called.

Mike42\Escpos\Printer::cut (   $mode = Printer::CUT_FULL,
  $lines = 3 
)

Cut the paper.

Parameters
int$modeCut mode, either Printer::CUT_FULL or Printer::CUT_PARTIAL. If not specified, Printer::CUT_FULL will be used.
int$linesNumber of lines to feed
static Mike42\Escpos\Printer::dataHeader ( array  $inputs,
  $long = true 
)
staticprotected

Convert widths and heights to characters. Used before sending graphics to set the size.

Parameters
array$inputs
boolean$longTrue to use 4 bytes, false to use 2
Returns
string
Mike42\Escpos\Printer::feed (   $lines = 1)

Print and feed line / Print and feed n lines.

Parameters
int$linesNumber of lines to feed
Mike42\Escpos\Printer::feedForm ( )

Some printers require a form feed to release the paper. On most printers, this command is only useful in page mode, which is not implemented in this driver.

Mike42\Escpos\Printer::feedReverse (   $lines = 1)

Print and reverse feed n lines.

Parameters
int$linesnumber of lines to feed. If not specified, 1 line will be fed.
Mike42\Escpos\Printer::getCharacterTable ( )
Returns
number
Mike42\Escpos\Printer::getPrintBuffer ( )
Returns
PrintBuffer
Mike42\Escpos\Printer::getPrintConnector ( )
Returns
PrintConnector
Mike42\Escpos\Printer::getPrinterCapabilityProfile ( )
Mike42\Escpos\Printer::graphics ( EscposImage  $img,
  $size = Printer::IMG_DEFAULT 
)

Print an image to the printer.

Size modifiers are:

See the example/ folder for detailed examples.

The functions bitImage() and bitImageColumnFormat() take the same parameters, and can be used if your printer doesn't support the newer graphics commands.

Parameters
EscposImage$imgThe image to print.
int$sizeSize modifier for the image. Must be either Printer::IMG_DEFAULT (default), or any combination of the Printer::IMG_DOUBLE_HEIGHT and Printer::IMG_DOUBLE_WIDTH flags.
Mike42\Escpos\Printer::initialize ( )

Initialize printer. This resets formatting back to the defaults.

static Mike42\Escpos\Printer::intLowHigh (   $input,
  $length 
)
staticprotected

Generate two characters for a number: In lower and higher parts, or more parts as needed.

Parameters
int$inputInput number
int$lengthThe number of bytes to output (1 - 4).
Mike42\Escpos\Printer::pdf417Code (   $content,
  $width = 3,
  $heightMultiplier = 3,
  $dataColumnCount = 0,
  $ec = 0.10,
  $options = Printer::PDF417_STANDARD 
)

Print a two-dimensional data code using the PDF417 standard.

Parameters
string$contentText or numbers to store in the code
int$widthWidth of a module (pixel) in the printed code. Default is 3 dots.
int$heightMultiplierMultiplier for height of a module. Default is 3 times the width.
int$dataColumnCountNumber of data columns to use. 0 (default) is to auto-calculate. Smaller numbers will result in a narrower code, making larger pixel sizes possible. Larger numbers require smaller pixel sizes.
float$ecError correction ratio, from 0.01 to 4.00. Default is 0.10 (10%).
int$optionsStandard code Printer::PDF417_STANDARD with start/end bars, or truncated code Printer::PDF417_TRUNCATED with start bars only.
Exceptions
ExceptionIf this profile indicates that PDF417 code is not supported
Mike42\Escpos\Printer::pulse (   $pin = 0,
  $on_ms = 120,
  $off_ms = 240 
)

Generate a pulse, for opening a cash drawer if one is connected. The default settings should open an Epson drawer.

Parameters
int$pin0 or 1, for pin 2 or pin 5 kick-out connector respectively.
int$on_mspulse ON time, in milliseconds.
int$off_mspulse OFF time, in milliseconds.
Mike42\Escpos\Printer::qrCode (   $content,
  $ec = Printer::QR_ECLEVEL_L,
  $size = 3,
  $model = Printer::QR_MODEL_2 
)

Print the given data as a QR code on the printer.

Parameters
string$contentThe content of the code. Numeric data will be more efficiently compacted.
int$ecError-correction level to use. One of Printer::QR_ECLEVEL_L (default), Printer::QR_ECLEVEL_M, Printer::QR_ECLEVEL_Q or Printer::QR_ECLEVEL_H. Higher error correction results in a less compact code.
int$sizePixel size to use. Must be 1-16 (default 3)
int$modelQR code model to use. Must be one of Printer::QR_MODEL_1, Printer::QR_MODEL_2 (default) or Printer::QR_MICRO (not supported by all printers).
Mike42\Escpos\Printer::release ( )

Some slip printers require ESC q sequence to release the paper.

Mike42\Escpos\Printer::selectCharacterTable (   $table = 0)

Switch character table (code page) manually. Used in conjunction with textRaw() to print special characters which can't be encoded automatically.

Parameters
int$tableThe table to select. Available code tables are model-specific.
Mike42\Escpos\Printer::selectPrintMode (   $mode = Printer::MODE_FONT_A)

Select print mode(s).

Several MODE_* constants can be OR'd together passed to this function's $mode argument. The valid modes are:

Parameters
int$modeThe mode to use. Default is Printer::MODE_FONT_A, with no special formatting. This has a similar effect to running initialize().
Mike42\Escpos\Printer::setBarcodeHeight (   $height = 8)

Set barcode height.

Parameters
int$heightHeight in dots. If not specified, 8 will be used.
Mike42\Escpos\Printer::setBarcodeTextPosition (   $position = Printer::BARCODE_TEXT_NONE)

Set the position for the Human Readable Interpretation (HRI) of barcode characters.

Parameters
int$position,.Use Printer::BARCODE_TEXT_NONE to hide the text (default), or any combination of Printer::BARCODE_TEXT_ABOVE and Printer::BARCODE_TEXT_BELOW flags to display the text.
Mike42\Escpos\Printer::setBarcodeWidth (   $width = 3)

Set barcode bar width.

Parameters
int$widthBar width in dots. If not specified, 3 will be used. Values above 6 appear to have no effect.
Mike42\Escpos\Printer::setColor (   $color = Printer::COLOR_1)

Select print color on printers that support multiple colors.

Parameters
int$colorColor to use. Must be either Printer::COLOR_1 (default), or Printer::COLOR_2.
Mike42\Escpos\Printer::setDoubleStrike (   $on = true)

Turn double-strike mode on/off.

Parameters
boolean$ontrue for double strike, false for no double strike
Mike42\Escpos\Printer::setEmphasis (   $on = true)

Turn emphasized mode on/off.

Parameters
boolean$ontrue for emphasis, false for no emphasis
Mike42\Escpos\Printer::setFont (   $font = Printer::FONT_A)

Select font. Most printers have two fonts (Fonts A and B), and some have a third (Font C).

Parameters
int$fontThe font to use. Must be either Printer::FONT_A, Printer::FONT_B, or Printer::FONT_C.
Mike42\Escpos\Printer::setJustification (   $justification = Printer::JUSTIFY_LEFT)

Select justification.

Parameters
int$justificationOne of Printer::JUSTIFY_LEFT, Printer::JUSTIFY_CENTER, or Printer::JUSTIFY_RIGHT.
Mike42\Escpos\Printer::setLineSpacing (   $height = null)

Set the height of the line.

Some printers will allow you to overlap lines with a smaller line feed.

Parameters
int | null$heightThe height of each line, in dots. If not set, the printer will reset to its default line spacing.
Mike42\Escpos\Printer::setPrintBuffer ( PrintBuffer  $buffer)

Attach a different print buffer to the printer. Buffers are responsible for handling text output to the printer.

Parameters
PrintBuffer$bufferThe buffer to use.
Exceptions
InvalidArgumentExceptionWhere the buffer is already attached to a different printer.
Mike42\Escpos\Printer::setPrintLeftMargin (   $margin = 0)

Set print area left margin. Reset to default with Printer::initialize()

Parameters
int$marginThe left margin to set on to the print area, in dots.
Mike42\Escpos\Printer::setPrintWidth (   $width = 512)

Set print area width. This can be used to add a right margin to the print area. Reset to default with Printer::initialize()

Parameters
int$widthThe width of the page print area, in dots.
Mike42\Escpos\Printer::setReverseColors (   $on = true)

Set black/white reverse mode on or off. In this mode, text is printed white on a black background.

Parameters
boolean$onTrue to enable, false to disable.
Mike42\Escpos\Printer::setTextSize (   $widthMultiplier,
  $heightMultiplier 
)

Set the size of text, as a multiple of the normal size.

Parameters
int$widthMultiplierMultiple of the regular height to use (range 1 - 8)
int$heightMultiplierMultiple of the regular height to use (range 1 - 8)
Mike42\Escpos\Printer::setUnderline (   $underline = Printer::UNDERLINE_SINGLE)

Set underline for printed text.

Argument can be true/false, or one of UNDERLINE_NONE, UNDERLINE_SINGLE or UNDERLINE_DOUBLE.

Parameters
int$underlineEither true/false, or one of Printer::UNDERLINE_NONE, Printer::UNDERLINE_SINGLE or Printer::UNDERLINE_DOUBLE. Defaults to Printer::UNDERLINE_SINGLE.
Mike42\Escpos\Printer::setUpsideDown (   $on = true)

Print each line upside-down (180 degrees rotated).

Parameters
boolean$onTrue to enable, false to disable.
Mike42\Escpos\Printer::text (   $str = "")

Add text to the buffer.

Text should either be followed by a line-break, or feed() should be called after this to clear the print buffer.

Parameters
string$strText to print
Mike42\Escpos\Printer::textChinese (   $str = "")

Add Chinese text to the buffer. This is a specific workaround for the common Zijang printer- The printer will be switched to a two-byte mode and sent GBK-encoded text.

Support for this will be merged into a print buffer.

Parameters
string$strText to print, as UTF-8
Mike42\Escpos\Printer::textRaw (   $str = "")

Add text to the buffer without attempting to interpret chararacter codes.

Text should either be followed by a line-break, or feed() should be called after this to clear the print buffer.

Parameters
string$strText to print
static Mike42\Escpos\Printer::validateBoolean (   $test,
  $source 
)
staticprotected

Throw an exception if the argument given is not a boolean

Parameters
boolean$testthe input to test
string$sourcethe name of the function calling this
static Mike42\Escpos\Printer::validateFloat (   $test,
  $min,
  $max,
  $source,
  $argument = "Argument" 
)
staticprotected

Throw an exception if the argument given is not a float within the specified range

Parameters
float$testthe input to test
float$minthe minimum allowable value (inclusive)
float$maxthe maximum allowable value (inclusive)
string$sourcethe name of the function calling this
string$argumentthe name of the invalid parameter
static Mike42\Escpos\Printer::validateInteger (   $test,
  $min,
  $max,
  $source,
  $argument = "Argument" 
)
staticprotected

Throw an exception if the argument given is not an integer within the specified range

Parameters
int$testthe input to test
int$minthe minimum allowable value (inclusive)
int$maxthe maximum allowable value (inclusive)
string$sourcethe name of the function calling this
string$argumentthe name of the invalid parameter
static Mike42\Escpos\Printer::validateIntegerMulti (   $test,
array  $ranges,
  $source,
  $argument = "Argument" 
)
staticprotected

Throw an exception if the argument given is not an integer within one of the specified ranges

Parameters
int$testthe input to test
array$rangesarray of two-item min/max ranges.
string$sourcethe name of the function calling this
string$sourcethe name of the function calling this
string$argumentthe name of the invalid parameter
static Mike42\Escpos\Printer::validateString (   $test,
  $source,
  $argument = "Argument" 
)
staticprotected

Throw an exception if the argument given can't be cast to a string

Parameters
string$testthe input to test
string$sourcethe name of the function calling this
string$argumentthe name of the parameter being validated
Exceptions
InvalidArgumentExceptionWhere the argument is not valid
static Mike42\Escpos\Printer::validateStringRegex (   $test,
  $source,
  $regex,
  $argument = "Argument" 
)
staticprotected

Throw an exception if the argument doesn't match the given regex.

Parameters
string$testthe input to test
string$sourcethe name of the function calling this
string$regexvalid values for this attribute, as a regex
string$argumentthe name of the parameter being validated
Exceptions
InvalidArgumentExceptionWhere the argument is not valid
Mike42\Escpos\Printer::wrapperSend2dCodeData (   $fn,
  $cn,
  $data = '',
  $m = '' 
)
protected

Wrapper for GS ( k, to calculate and send correct data length.

Parameters
string$fnFunction to use
string$cnOutput code type. Affects available data
string$dataData to send.
string$mModifier/variant for function. Often '0' where used.
Exceptions
InvalidArgumentExceptionWhere the input lengths are bad.
Mike42\Escpos\Printer::wrapperSendGraphicsData (   $m,
  $fn,
  $data = '' 
)
protected

Wrapper for GS ( L, to calculate and send correct data length.

Parameters
string$mModifier/variant for function. Usually '0'.
string$fnFunction number to use, as character.
string$dataData to send.
Exceptions
InvalidArgumentExceptionWhere the input lengths are bad.

Member Data Documentation

PrintBuffer null Mike42\Escpos\Printer::$buffer
protected

The printer's output buffer.

int Mike42\Escpos\Printer::$characterTable
protected

Current character code table

PrintConnector Mike42\Escpos\Printer::$connector
protected

Connector showing how to print to this printer

CapabilityProfile Mike42\Escpos\Printer::$profile
protected

Profile showing supported features for this printer

const Mike42\Escpos\Printer::BARCODE_CODABAR = 71

Indicates CODABAR barcode when used with Printer::barcode

const Mike42\Escpos\Printer::BARCODE_CODE128 = 73

Indicates CODE128 barcode when used with Printer::barcode

const Mike42\Escpos\Printer::BARCODE_CODE39 = 69

Indicates CODE39 barcode when used with Printer::barcode

const Mike42\Escpos\Printer::BARCODE_CODE93 = 72

Indicates CODE93 barcode when used with Printer::barcode

const Mike42\Escpos\Printer::BARCODE_ITF = 70

Indicates ITF barcode when used with Printer::barcode

const Mike42\Escpos\Printer::BARCODE_JAN13 = 67

Indicates JAN13 barcode when used with Printer::barcode

const Mike42\Escpos\Printer::BARCODE_JAN8 = 68

Indicates JAN8 barcode when used with Printer::barcode

const Mike42\Escpos\Printer::BARCODE_TEXT_ABOVE = 1

Indicates that HRI (human-readable interpretation) text should be printed above a barcode, when used with Printer::setBarcodeTextPosition

const Mike42\Escpos\Printer::BARCODE_TEXT_BELOW = 2

Indicates that HRI (human-readable interpretation) text should be printed below a barcode, when used with Printer::setBarcodeTextPosition

const Mike42\Escpos\Printer::BARCODE_TEXT_NONE = 0

Indicates that HRI (human-readable interpretation) text should not be printed, when used with Printer::setBarcodeTextPosition

const Mike42\Escpos\Printer::BARCODE_UPCA = 65

Indicates UPC-A barcode when used with Printer::barcode

const Mike42\Escpos\Printer::BARCODE_UPCE = 66

Indicates UPC-E barcode when used with Printer::barcode

const Mike42\Escpos\Printer::COLOR_1 = 0

Use the first color (usually black), when used with Printer::setColor

const Mike42\Escpos\Printer::COLOR_2 = 1

Use the second color (usually red or blue), when used with Printer::setColor

const Mike42\Escpos\Printer::CUT_FULL = 65

Make a full cut, when used with Printer::cut

const Mike42\Escpos\Printer::CUT_PARTIAL = 66

Make a partial cut, when used with Printer::cut

const Mike42\Escpos\Printer::DLE = "\x10"

ASCII data link escape control character

const Mike42\Escpos\Printer::EOT = "\x04"

ASCII end of transmission control character

const Mike42\Escpos\Printer::ESC = "\x1b"

ASCII escape control character

const Mike42\Escpos\Printer::FF = "\x0c"

ASCII form feed control character

const Mike42\Escpos\Printer::FONT_A = 0

Use Font A, when used with Printer::setFont

const Mike42\Escpos\Printer::FONT_B = 1

Use Font B, when used with Printer::setFont

const Mike42\Escpos\Printer::FONT_C = 2

Use Font C, when used with Printer::setFont

const Mike42\Escpos\Printer::FS = "\x1c"

ASCII form separator control character

const Mike42\Escpos\Printer::GS = "\x1d"

ASCII group separator control character

const Mike42\Escpos\Printer::IMG_DEFAULT = 0

Use default (high density) image size, when used with Printer::graphics, Printer::bitImage or Printer::bitImageColumnFormat

const Mike42\Escpos\Printer::IMG_DOUBLE_HEIGHT = 2

Use lower vertical density for image printing, when used with Printer::graphics, Printer::bitImage or Printer::bitImageColumnFormat

const Mike42\Escpos\Printer::IMG_DOUBLE_WIDTH = 1

Use lower horizontal density for image printing, when used with Printer::graphics, Printer::bitImage or Printer::bitImageColumnFormat

const Mike42\Escpos\Printer::JUSTIFY_CENTER = 1

Center text, when used with Printer::setJustification

const Mike42\Escpos\Printer::JUSTIFY_LEFT = 0

Align text to the left, when used with Printer::setJustification

const Mike42\Escpos\Printer::JUSTIFY_RIGHT = 2

Align text to the right, when used with Printer::setJustification

const Mike42\Escpos\Printer::LF = "\x0a"

ASCII linefeed control character

const Mike42\Escpos\Printer::MODE_DOUBLE_HEIGHT = 16

Use double height text, when used with Printer::selectPrintMode

const Mike42\Escpos\Printer::MODE_DOUBLE_WIDTH = 32

Use double width text, when used with Printer::selectPrintMode

const Mike42\Escpos\Printer::MODE_EMPHASIZED = 8

Use text emphasis, when used with Printer::selectPrintMode

const Mike42\Escpos\Printer::MODE_FONT_A = 0

Use Font A, when used with Printer::selectPrintMode

const Mike42\Escpos\Printer::MODE_FONT_B = 1

Use Font B, when used with Printer::selectPrintMode

const Mike42\Escpos\Printer::MODE_UNDERLINE = 128

Underline text, when used with Printer::selectPrintMode

const Mike42\Escpos\Printer::NUL = "\x00"

ASCII null control character

const Mike42\Escpos\Printer::PDF417_STANDARD = 0

Indicates standard PDF417 code

const Mike42\Escpos\Printer::PDF417_TRUNCATED = 1

Indicates truncated PDF417 code

const Mike42\Escpos\Printer::QR_ECLEVEL_H = 3

Indicates error correction level H when used with Printer::qrCode

const Mike42\Escpos\Printer::QR_ECLEVEL_L = 0

Indicates error correction level L when used with Printer::qrCode

const Mike42\Escpos\Printer::QR_ECLEVEL_M = 1

Indicates error correction level M when used with Printer::qrCode

const Mike42\Escpos\Printer::QR_ECLEVEL_Q = 2

Indicates error correction level Q when used with Printer::qrCode

const Mike42\Escpos\Printer::QR_MICRO = 3

Indicates micro QR code when used with Printer::qrCode

const Mike42\Escpos\Printer::QR_MODEL_1 = 1

Indicates QR model 1 when used with Printer::qrCode

const Mike42\Escpos\Printer::QR_MODEL_2 = 2

Indicates QR model 2 when used with Printer::qrCode

const Mike42\Escpos\Printer::STATUS_ERROR_CAUSE = 3

Indicates a request for error cause when used with Printer::getPrinterStatus (experimental)

const Mike42\Escpos\Printer::STATUS_INK_A = 7

Indicates a request for ink A status when used with Printer::getPrinterStatus (experimental)

const Mike42\Escpos\Printer::STATUS_INK_B = 6

Indicates a request for ink B status when used with Printer::getPrinterStatus (experimental)

const Mike42\Escpos\Printer::STATUS_OFFLINE_CAUSE = 2

Indicates a request for printer offline cause when used with Printer::getPrinterStatus (experimental)

const Mike42\Escpos\Printer::STATUS_PAPER_ROLL = 4

Indicates a request for error cause when used with Printer::getPrinterStatus (experimental)

const Mike42\Escpos\Printer::STATUS_PEELER = 8

Indicates a request for peeler status when used with Printer::getPrinterStatus (experimental)

const Mike42\Escpos\Printer::STATUS_PRINTER = 1

Indicates a request for printer status when used with Printer::getPrinterStatus (experimental)

const Mike42\Escpos\Printer::UNDERLINE_DOUBLE = 2

Indicates double underline when used with Printer::setUnderline

const Mike42\Escpos\Printer::UNDERLINE_NONE = 0

Indicates no underline when used with Printer::setUnderline

const Mike42\Escpos\Printer::UNDERLINE_SINGLE = 1

Indicates single underline when used with Printer::setUnderline


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