Sample Program

JavaPOS offers Sample Program for POS Printer and  Cashdrawer in the path of "Samples".

 Sample Program for POS Printer:

Initialize Dialog

function Open device ,initialize printer
Method open, claim, setDeviceEnabled, setMapMode, setBitmap

Sample Print

function Samples print
Method  transactionPrint, printNormal, cutPaper

Logo/Barcode

function Logo and Barcode print
Method transactionPrint, printNormal(PTR_S_RECEIPT, ESC + "|1B")(Print the bitmap), printBarCode, printNormal, cutPaper

Merchant

function Supermarket bill print sample
Method transactionPrint, printNormal, cutPaper

Customer

function Supermarket bill print sample and Barcode print
Method transactionPrint, printNormal, printBarCode, cutPaper

Print Receipt

function Rotate Print sample
Method getCapRecPresent, getCapRecLeft90, setAsyncMode, rotatePrint, printNormal, setRecLineSpacing, printBarCode, cutPaper

ATM Receipt

function ATM  Print sample
Method printNormal, cutPaper

Account Summ

function Account  Print sample and asynchronous print
Method setAsyncMode, rotatePrint, printNormal, cutPaper

DirectIO Sample

function DirectIO Sample,print data directly
Method directIO, printNormal

Other Event

function detect  status of device.
Event StatusUpdateEvent

Sample Program for Cashdrawer:

Initial Dialog

function Claim device .
Method open, claim, setDeviceEnabled.

Open Drawer

function Open drawer
Method openDrawer

Other Event

function detect  status of device.
Event StatusUpdateEvent

For more information, see:

Programming introduction

Data Characters and Escape Sequences

 Application development guide