CORE POS - IS4C
The CORE POS front end
Public Member Functions | List of all members
PrintHandler Class Reference
Inheritance diagram for PrintHandler:
EmailPrintHandler ESCPOSPrintHandler

Public Member Functions

 Tab ()
 
 LineFeed ($lines=1)
 
 PageFeed ($reset=true)
 
 CarriageReturn ()
 
 ClearPage ()
 
 CharacterSpacing ($dots=0)
 
 centerString ($text, $big=false)
 
 TextStyle ($altFont=false, $bold=false, $tall=false, $wide=false, $underline=false)
 
 GotoX ($dots=0)
 
 TransposeBitmapData ($data, $width, $tallDots=false)
 
 InlineBitmap ($data, $width, $tallDots=false, $wideDots=false)
 
 Underline ($dots=1)
 
 ResetLineSpacing ()
 
 LineSpacing ($space=64)
 
 Reset ()
 
 SetTabs ($tabs=null)
 
 Bold ($on=true)
 
 DoublePrint ($on=true)
 
 PaperFeed ($space)
 
 PaperFeedBack ($space)
 
 PageMode ()
 
 Font ($font=0)
 
 CharacterSet ($set=0)
 
 LineMode ()
 
 PageOrient ($orient=0)
 
 Rotate ($on=true)
 
 PageRegion ($x=0, $y=0, $dx=65535, $dy=65535)
 
 MoveX ($dots)
 
 AlignLeft ()
 
 AlignCenter ()
 
 AlignRight ()
 
 PaperRoll ($receipt=true, $journal=false, $endorse=false, $validation=false)
 
 PanelButtons ($on=true)
 
 LineFeedBack ()
 
 DrawerKick ($pin=2, $on=100, $off=100)
 
 CodeTable ($table=0)
 
 UpsideDown ($on=true)
 
 CharacterZoom ($horiz=1, $vert=1)
 
 GotoY ($dots=0)
 
 Test ($type=3, $paper=0)
 
 Density ($factor=1.0)
 
 ColorBlack ()
 
 ColorRed ()
 
 Invert ($on=true)
 
 SpeedHigh ()
 
 SpeedMedium ()
 
 SpeedLow ()
 
 BarcodeHRI ($below=true, $above=false)
 
 LeftMargin ($dots=0)
 
 DotPitch ($primary=0, $secondary=0)
 
 DiscardLine ()
 
 PreCutPaper ($full=false)
 
 CutPaper ($full=false, $feed=0)
 
 PrintableWidth ($dots=65535)
 
 MoveY ($dots)
 
 Smooth ($on=true)
 
 BarcodeHRIFont ($font=0)
 
 BarcodeHeight ($dots=162)
 
 BarcodeUPC ($data, $upcE=false)
 
 BarcodeEAN ($data, $ean8=false)
 
 BarcodeCODE39 ($data)
 
 BarcodeITF ($data)
 
 BarcodeCODEABAR ($data)
 
 BarcodeCODE93 ($data)
 
 BarcodeCODE128 ($data)
 
 RasterBitmap ($data, $width, $height, $tallDots=false, $wideDots=false)
 
 BarcodeWidth ($scale=3)
 
 writeLine ($text)
 
 RenderBitmapFromFile ($fn, $align='C')
 
 RenderBitmap ($arg, $align='C')
 
 rawEscCommand ($command)
 
 renderBitmapFromRam ($image_id)
 

Detailed Description

Generic print module

This is working backwards from the existing ESCPOS class. Work-in-progress.

Member Function Documentation

PrintHandler::Bold (   $on = true)

Enable or disable bold font

Parameters
$onboolean enable
Returns
string printer command
PrintHandler::CarriageReturn ( )

Get carriage return

Returns
string printer command
PrintHandler::centerString (   $text,
  $big = false 
)

Center a string of text

Parameters
$textthe text
$bigboolean using larger font
Returns
a printable string

Replaces old center(), centerString(), and centerBig() functions.

PrintHandler::LineFeed (   $lines = 1)

Get newlines

Parameters
$linesnumber of lines
Returns
string printer command
PrintHandler::rawEscCommand (   $command)

Wrapper for raw ESC byte strings so subclass handlers can decide whether they're compatible

Parameters
$command[string] command bytes
Returns
[string] receipt text
PrintHandler::RenderBitmap (   $arg,
  $align = 'C' 
)

Turn bitmap into receipt string

Parameters
$argstring filename OR Bitmap obj
Returns
receipt-formatted string
PrintHandler::RenderBitmapFromFile (   $fn,
  $align = 'C' 
)

Draw bitmap from file

Parameters
$fna bitmap file
Returns
printer command string
PrintHandler::renderBitmapFromRam (   $image_id)

Show bitmap stored on the printer device itself

Parameters
$image_id[int] storage location ID
Returns
[string] receipt text
PrintHandler::Tab ( )

Get printer tab

Returns
string printer command
PrintHandler::TextStyle (   $altFont = false,
  $bold = false,
  $tall = false,
  $wide = false,
  $underline = false 
)

Add font style command

Parameters
$altFontuse alternate font
$bolduse bold font
$talluse tall characters
$wideuse wide characters
$underlineuse undlerined font
Returns
A printer command string

Replaces several old printLib.php functions TextStyle(true) is equivalent to normalFont() TextStyle(true,true) is equivalent to boldFont() TextStyle(true,false,true) is equivalent to biggerFont().

PrintHandler::writeLine (   $text)

Write output to device

Parameters
theoutput string

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