1 POSPrinter

Class Ax.pos.POSPrinter


Class to represent a POS printer.

Constructor Summary

Method
Description
Creates a new POS printer instance.

Method Summary

Modifier and Type
Method
Description
build()
Gives access to the underlying EscPosWriter to work with it.

Constructor Detail

Ax.pos.POSPrinter.JSPOSPrinter

Ax.pos.POSPrinter.JSPOSPrinter()
Info:
Creates a new POS printer instance.

Method Detail

Ax.pos.POSPrinter.build

object Ax.pos.POSPrinter.build()
Info:
Gives access to the underlying EscPosWriter to work with it.
Returns:
object

2 POSImage

Class Ax.pos.POSImage


Wrapper to access EscPosImage generation.

Constructor Summary

Method
Description
Creates a new JSPOSImage from the given source data.

Method Summary

Modifier and Type
Method
Description
int 
Gets the image height in bits.
int 
Gets the image width in bits.
Ax.pos.POSImage 
scale(double scale)
Scales the image.
Ax.pos.POSImage 
scaleToFit(int width)
Scales tha image to fit the specified width maintaining the same width:height ratio.
Ax.pos.POSImage 
Creates a new BitonalOrderedDither with default values.
Ax.pos.POSImage 
setBitonalOrderedDither(int matrixWidth,int matrixHeight)
Creates a new BitonalOrderedDither with
Ax.pos.POSImage 
setBitonalThreshold(int threshold)
Sets the image bitonal threshhold (the point on a scale, ranging from 0 (black) to 255 (white), at which the gray values captured will be converted to black or white pixels).
byte[] 
Converts the image to a graphic print image.
byte[] 
Converts the image to a Raster bit Image.

Constructor Detail

Ax.pos.POSImage.JSPOSImage

Ax.pos.POSImage.JSPOSImage(
	object data
						)
Info:
Creates a new JSPOSImage from the given source data.
Parameters:
data - the source data as a (byte[], File, Blob...)

Method Detail

Ax.pos.POSImage.getHeight

smallint Ax.pos.POSImage.getHeight()
Info:
Gets the image height in bits.
Returns:
smallint

Ax.pos.POSImage.getWidth

smallint Ax.pos.POSImage.getWidth()
Info:
Gets the image width in bits.
Returns:
smallint

Ax.pos.POSImage.scale

object Ax.pos.POSImage.scale(
	double scale
)
Info:
Scales the image.
Parameters:
scale - a percent factor to scale, like 2 or 0.5
Returns:
object

Ax.pos.POSImage.scaleToFit

object Ax.pos.POSImage.scaleToFit(
	smallint width
)
Info:
Scales tha image to fit the specified width maintaining the same width:height ratio.
Parameters:
width - the new width in bits
Returns:
object

Ax.pos.POSImage.setBitonalOrderedDither

object Ax.pos.POSImage.setBitonalOrderedDither()
Info:
Creates a new BitonalOrderedDither with default values.
Returns:
object

Ax.pos.POSImage.setBitonalOrderedDither

object Ax.pos.POSImage.setBitonalOrderedDither(
	smallint matrixWidth,
	smallint matrixHeight
)
Info:
Creates a new BitonalOrderedDither with
Parameters:
matrixWidth - width of <code> ditherMatrix </code> must be &gt; 0
matrixHeight - height of <code> ditherMatrix </code> must be &gt; 0
Returns:
object

Example
Copy
ditherMatrix[matrixWidth][matrixHeight]
Example
Copy
width of ditherMatrix
Example
Copy
ditherMatrix

Ax.pos.POSImage.setBitonalThreshold

object Ax.pos.POSImage.setBitonalThreshold(
	smallint threshold
)
Info:
Sets the image bitonal threshhold (the point on a scale, ranging from 0 (black) to 255 (white), at which the gray values captured will be converted to black or white pixels).
Parameters:
threshold - unique threshold value with range 0 to 255.
Returns:
object

Ax.pos.POSImage.toGraphic

byte[] Ax.pos.POSImage.toGraphic()
Info:
Converts the image to a graphic print image. Graphics print Image commands using
Returns:
byte[]

Example
Copy
GS(L

Ax.pos.POSImage.toRaster

byte[] Ax.pos.POSImage.toRaster()
Info:
Converts the image to a Raster bit Image. Raster bit Image commands using
Returns:
byte[]

Example
Copy
GS 'v' '0'

3 POSBarcode

Class Ax.pos.POSBarcode


Class to generate ESC/POS barcode sequences, that canbe sent diractly to a POS printer or to be used by JSPOSPrinter class.

Constructor Summary

Method
Description
JSPOSBarcode(Ax.text.String type)
Creates a new JSPOSBarcode with the specified barcode type.

Method Summary

Modifier and Type
Method
Description
byte[] 
print(Ax.text.String data)
Returns the barcode in ESC/POS bytes.
Ax.pos.POSBarcode 
setAlign(Ax.text.String align)
Sets the barcode alignment.
Ax.pos.POSBarcode 
setSize(int width, int height)
Sets the barcode size in dots.
Ax.pos.POSBarcode 
setTextPosition(Ax.text.String position)
Sets the text position in the barcode.

Constructor Detail

Ax.pos.POSBarcode.JSPOSBarcode

Ax.pos.POSBarcode.JSPOSBarcode(
	string type
						)
Info:
Creates a new JSPOSBarcode with the specified barcode type. Types are: UPCA, UPCA_B, UPCE_A, UPCE_B, EAN13_A, EAN13_B, EAN8_A, EAN8_B, CODE39_A, CODE39_B, ITF_A, ITF_B, CODABAR_A, CODABAR_B, CODE93, CODE128.
Parameters:
type - the barcode type

Method Detail

Ax.pos.POSBarcode.print

byte[] Ax.pos.POSBarcode.print(
	string data
)
Info:
Returns the barcode in ESC/POS bytes.
Parameters:
data - the data to be encoded in the barcode
Returns:
byte[]

Ax.pos.POSBarcode.setAlign

object Ax.pos.POSBarcode.setAlign(
	string align
)
Info:
Sets the barcode alignment. It can be: LEFT, CENTER, RIGHT.
Parameters:
align - the alignment
Returns:
object

Ax.pos.POSBarcode.setSize

object Ax.pos.POSBarcode.setSize(
	smallint width,
	smallint height
)
Info:
Sets the barcode size in dots.
Parameters:
width - the barcode width in dots
height - the barcode height in dots
Returns:
object

Ax.pos.POSBarcode.setTextPosition

object Ax.pos.POSBarcode.setTextPosition(
	string position
)
Info:
Sets the text position in the barcode. Positions are: NONE, ABOVE, BELOW, ABOVEANDBELOW.
Parameters:
position - the text position
Returns:
object

4 POSQRCode

Class Ax.pos.POSQRCode


Class to work with QRCode barcodes for POS printers. ESC POS QRCODE

Constructor Summary

Method
Description
Creats a new POS QRCode instance.

Method Summary

Modifier and Type
Method
Description
byte[] 
print(Ax.text.String data)
Returns the QRCode assembly into ESC/POS bytes.
Ax.pos.POSQRCode 
setAlign(Ax.text.String align)
Sets the barcode alignment: LEFT, CENTER, RIGHT
Ax.pos.POSQRCode 
setErrorCorrectionLevel(Ax.text.String level)
Sets the QRCode error correction level: L (7%), M (15%), Q (25%), H (30%).
Ax.pos.POSQRCode 
setSize(int width)
Sets the width of the barcode in dots.

Constructor Detail

Ax.pos.POSQRCode.JSPOSQRCode

Ax.pos.POSQRCode.JSPOSQRCode()
Info:
Creats a new POS QRCode instance.

Method Detail

Ax.pos.POSQRCode.print

byte[] Ax.pos.POSQRCode.print(
	string data
)
Info:
Returns the QRCode assembly into ESC/POS bytes.
Parameters:
data - the data for assembly
Returns:
byte[]

Ax.pos.POSQRCode.setAlign

object Ax.pos.POSQRCode.setAlign(
	string align
)
Info:
Sets the barcode alignment: LEFT, CENTER, RIGHT
Parameters:
align - the barcode alignment
Returns:
object

Ax.pos.POSQRCode.setErrorCorrectionLevel

object Ax.pos.POSQRCode.setErrorCorrectionLevel(
	string level
)
Info:
Sets the QRCode error correction level: L (7%), M (15%), Q (25%), H (30%).
Parameters:
level - the error correction level
Returns:
object

Ax.pos.POSQRCode.setSize

object Ax.pos.POSQRCode.setSize(
	smallint width
)
Info:
Sets the width of the barcode in dots.
Parameters:
width - the barcode width (between 1 and 16)
Returns:
object

5 POSPDF417

Class Ax.pos.POSPDF417


Class to work with PDF417 barcodes for POS printers. ESC POS PDF417

Constructor Summary

Method
Description
Creates a new JSPOSPDF417 instance.

Method Summary

Modifier and Type
Method
Description
byte[] 
print(Ax.text.String data)
Returns the PDF417 barcode assembly into ESC/POS bytes.
Ax.pos.POSPDF417 
setAlign(Ax.text.String align)
Ax.pos.POSPDF417 
setErrorCorrectionLevel(Ax.text.String level)
Sets the PDF417 error correction level, from L0 to L8.
Ax.pos.POSPDF417 
setSize(int width,int height)
Sets the barcode size.

Constructor Detail

Ax.pos.POSPDF417.JSPOSPDF417

Ax.pos.POSPDF417.JSPOSPDF417()
Info:
Creates a new JSPOSPDF417 instance.

Method Detail

Ax.pos.POSPDF417.print

byte[] Ax.pos.POSPDF417.print(
	string data
)
Info:
Returns the PDF417 barcode assembly into ESC/POS bytes.
Parameters:
data - the data for assembly
Returns:
byte[]

Ax.pos.POSPDF417.setAlign

object Ax.pos.POSPDF417.setAlign(
	string align
)
Parameters:
align - 
Returns:
object

Ax.pos.POSPDF417.setErrorCorrectionLevel

object Ax.pos.POSPDF417.setErrorCorrectionLevel(
	string level
)
Info:
Sets the PDF417 error correction level, from L0 to L8.
Parameters:
level - the error correction level
Returns:
object

Ax.pos.POSPDF417.setSize

object Ax.pos.POSPDF417.setSize(
	smallint width,
	smallint height
)
Info:
Sets the barcode size.
Parameters:
width - barcode width (between 2 and 8)
height - barcode height (between 2 and 8)
Returns:
object

6 Label

Class Ax.pos.zebra.Label


Zebra Programming Language (ZPL and ZPL II) is a page description language from Zebra Technologies. This class provides a fluent api for most common ZPL instructions.

Constructor Summary

Method
Description
Creates a new JSZebraLabel instance.
JSZebraLabel(int width, int height)
Creates a new instance with the specified height and width.

Method Summary

Modifier and Type
Method
Description
addCode128(int positionX, int positionY, Ax.text.String text)
Adds a Code 128 barcode.
addCode39(int positionX,int positionY,Ax.text.String text)
Adds a Code 39 barcode.
addComment(Ax.text.String text)
Adds a text comment.
addGraphicBox(int positionX,int positionY,int width,int height)
Adds a graphic box.
addGraphicBox(int positionX, int positionY, int width, int height, int borderThickness)
Adds a graphic box.
addNative(Ax.text.String code)
Adds a native ZPL code fragment.
Adds a revers flag to the field, that is, the font color will be opposite of the background color.
addText(Ax.text.String text)
Adds a text field.
addText(Ax.text.String text, int fontSize)
Adds a text field.
addText(int positionX,int positionY,Ax.text.String text)
Adds a text field.
addText(int positionX, int positionY, Ax.text.String text, int fontSize)
Adds a text field.
changeFont(Ax.text.String font,int fontSize)
Changs the font and its size.
Ax.text.String 
toZPL()
Converts the zebra label object to the correposnding ZPL code

Constructor Detail

Ax.pos.zebra.Label.JSZebraLabel

Ax.pos.zebra.Label.JSZebraLabel()
Info:
Creates a new JSZebraLabel instance.

Ax.pos.zebra.Label.JSZebraLabel

Ax.pos.zebra.Label.JSZebraLabel(
	smallint width,
	smallint height
						)
Info:
Creates a new instance with the specified height and width.
Parameters:
width - the width in dots
height - the height in dots

Method Detail

Ax.pos.zebra.Label.addCode128

object Ax.pos.zebra.Label.addCode128(
	smallint positionX,
	smallint positionY,
	string text
)
Info:
Adds a Code 128 barcode.
Parameters:
positionX - the horizontal position of the barcode
positionY - the vertical position of the barcode
text - the barcode content
Returns:
object

Ax.pos.zebra.Label.addCode39

object Ax.pos.zebra.Label.addCode39(
	smallint positionX,
	smallint positionY,
	string text
)
Info:
Adds a Code 39 barcode.
Parameters:
positionX - the horizontal position of the barcode
positionY - the vertical position of the barcode
text - the barcode content
Returns:
object

Ax.pos.zebra.Label.addComment

object Ax.pos.zebra.Label.addComment(
	string text
)
Info:
Adds a text comment.
Parameters:
text - the text of the comment
Returns:
object

Ax.pos.zebra.Label.addGraphicBox

object Ax.pos.zebra.Label.addGraphicBox(
	smallint positionX,
	smallint positionY,
	smallint width,
	smallint height
)
Info:
Adds a graphic box.
Parameters:
positionX - the horizontal position of the barcode
positionY - the vertical position of the barcode
width - the box width
height - the box height
Returns:
object

Ax.pos.zebra.Label.addGraphicBox

object Ax.pos.zebra.Label.addGraphicBox(
	smallint positionX,
	smallint positionY,
	smallint width,
	smallint height,
	smallint borderThickness
)
Info:
Adds a graphic box.
Parameters:
positionX - the horizontal position of the barcode
positionY - the vertical position of the barcode
width - the box width
height - the box height
borderThickness - the thickness of the box border
Returns:
object

Ax.pos.zebra.Label.addNative

object Ax.pos.zebra.Label.addNative(
	string code
)
Info:
Adds a native ZPL code fragment.
Parameters:
code - the ZPL code
Returns:
object

Ax.pos.zebra.Label.addReverse

object Ax.pos.zebra.Label.addReverse()
Info:
Adds a revers flag to the field, that is, the font color will be opposite of the background color.
Returns:
object

Ax.pos.zebra.Label.addText

object Ax.pos.zebra.Label.addText(
	string text
)
Info:
Adds a text field.
Parameters:
text - the text content
Returns:
object

Ax.pos.zebra.Label.addText

object Ax.pos.zebra.Label.addText(
	string text,
	smallint fontSize
)
Info:
Adds a text field.
Parameters:
text - the text content
fontSize - the font size
Returns:
object

Ax.pos.zebra.Label.addText

object Ax.pos.zebra.Label.addText(
	smallint positionX,
	smallint positionY,
	string text
)
Info:
Adds a text field.
Parameters:
positionX - the horizontal position of the text
positionY - the vertical position of the text
text - the text content
Returns:
object

Ax.pos.zebra.Label.addText

object Ax.pos.zebra.Label.addText(
	smallint positionX,
	smallint positionY,
	string text,
	smallint fontSize
)
Info:
Adds a text field.
Parameters:
positionX - 
positionY - 
text - the text content
fontSize - the font size
Returns:
object

Ax.pos.zebra.Label.changeFont

object Ax.pos.zebra.Label.changeFont(
	string font,
	smallint fontSize
)
Info:
Changs the font and its size.
Parameters:
font - the new font
fontSize - the new font size (height)
Returns:
object

Ax.pos.zebra.Label.toZPL

string Ax.pos.zebra.Label.toZPL()
Info:
Converts the zebra label object to the correposnding ZPL code
Returns:
string