OKI PT390 Dual POS Printer Guide
Advertisement
Advertisement
PT390
POSPrinter, CashDrawer
Application Programmer's Guide of
Java for Retail POS Driver for
Serial/ USB Interface
Table of Contents
Preface
(1) OS being targeted by this driver
This JavaPOS driver targets the following operating systems.
- Microsoft(R) Windows(R) 2000
- Microsoft(R) Windows Server(TM) 2003
- Microsoft(R) Windows Server(TM) 2003 x64 Edition
- Microsoft(R) Windows(R) XP
- Microsoft(R) Windows(R) XP x64 Edition
- Microsoft(R) Windows(R) Embedded for Point of Service
- Microsoft(R) Windows Server(TM) 2008
- Microsoft(R) Windows Server(TM) 2008 x64 Edition
- Microsoft(R) Windows Vista(TM)
- Microsoft(R) Windows Vista(TM) x64 Edition
- Microsoft(R) Windows Server(TM) 2008R2 x64 Edition
- Microsoft(R) Windows 7
- Microsoft(R) Windows 7 x64 Edition
(2) Interface being supported by this driver
This JavaPOS driver is supporting the printer connection by the following interfaces.
- Windows : RS232C , USB
1
(3) Supplementation concerning '5. XML file Configuration '
An initial value of the serial and USB interface of JavaPOS driver configuration file ‘jpos.xml’ is different in
Windows.
- Windows
logicalName = "PT390SERPRT"
portName = "COM1"
LogFile = "*/Okidata/PT/log/PT390serprt%g.log"
logicalName = "PT390SER2PRT"
portName = "COM2"
LogFile = "*/Okidata/PT/log/PT390ser2prt%g.log"
logicalName = "PT390USBPRT"
LogFile = "*/Okidata/PT/log/PT390usbprt%g.log"
logicalName = "PT390USB2PRT"
LogFile = "*/Okidata/PT/log/PT390usb2prt%g.log"
(5) About the balloon message when the Java application is started on Windows Vista / 2008 / Windows7 / 2008R2
When you start the Java application when the operating system is Windows Vista / 2008 / Windows7 / 2008R2, and the Aero function is effective, balloon message "The color scheme has been changed" might be displayed.
There is no influence in the operation of the application though the Aero function temporarily becomes invalid when this message is displayed. Please click the balloon, and check "Don’t show me this again." when you do not want to make this message be displayed from next time.
2
(6) About the arrangement of JavaPOS driver and Java application in Windows.
Please put the Java application in the same hard disk drive as the JavaPOS driver. Please copy the following file in the JavaPOS driver storage folder (The example: \JavaPOS\Okidata\PT) to the following folder of J2SDK and use it when you put the Java application in a drive different from the JavaPOS driver. win32com.dll : [J2SDK folder]\jre\bin
LibIoOP.dll : [J2SDK folder]\jre\bin comm.jar : [J2SDK folder]\jre\lib\ext
(7) About the "Found New Hardware Wizard" in Windows
When the printer is connected to PC in USB interface and "Found New Hardware Wizard" was displayed, set it in the following procedures.
For Windows 7 / Server 2008 R2
1. The message "Installing device driver software" is displayed in a balloon(lower right corner of the screen).
2. After a while, the message "Device driver software was not successfully installed" is displayed.
This is not a problem.
For Windows Vista / Server 2008
1. The "Found New Hardware" is displayed, select [Don't show this message again for this device].
* When "User Account Control" screen is displayed, select [Continue].
For Windows XP / Server 2003 / WEPOS / WEPOS2009
1. The "Found New Hardware Wizard" screen is displayed. Select [No, not this time] and then click
[Next].
2. When "What do you want the wizard to do?" is displayed, select [Install from a list or specific location]
and then click [Next].
3. Select [Search for the best driver in these locations], clear all checkboxes and then click [Next].
4. When "Cannot Install this Hardware" is displayed, click [Don't prompt me again to install this software] and then click [Finish].
For Windows 2000
1. The "Found New Hardware Wizard" screen is displayed, click [Next].
2. When "What do you want the wizard to do?" is displayed, select [Search for a suitable driver for my device] and then click [Next].
3. When [Locate Driver Files] is displayed, clear all checkboxes and then click [Next].
4. When "Driver Files Search Results" is displayed, select [Disable the device] and then click [Finish].
3
1. Outline
POS Printer JavaPOS Driver and Drawer JavaPOS Driver that control POS Printer ("PT390") and Drawer connected to the printer are JavaPOS Driver conforming to JavaPOS Driver 1.10 POS Printer Devise and Drawer Device. When using this JavaPOS Driver, refer to "UifiedPOS Specification Version 1.10 Version", as well.
1.1. Subject Scope of this document
These instructions (Interface Instructions) aim for the main reference of programmers who develop the application for the use of this JavaPOS Driver, and describe the following contents necessary for that.
· Installation way of this JavaPOS Driver
Please refer to the installation text being bundled by the driver for the installation method.
Windows : "opinstall_win.txt"
· Restrictions of this JavaPOS Driver
· Useage of this JavaPOS printer setup tool
· Usage of this JavaPOS Driver
· Restrictions of this JavaPOS Driver
· Interface (Property/Method/Event) Remarks of this JavaPOS Driver
· Item Setting Remarks of this JavaPOS Driver
4
1.2. JavaPOS Driver Outline
1) JavaPOS Driver Configuration Drawing
JavaPOS Driver provides the properties, methods and events to the application. The driver is invisible on UI during application execution. Only the application, which uses it, requests to process through the method and property. The application receives the processing result through the parameter, property, event and error.
Application
POSPrinter Device
Control
CashDrawer
Device Control
POSPrinter Device
Service
CashDrawer
Device Service
Java VM
OS / Device Driver
Printer Drawer
Serial Interface
Printer Drawer
USB Interface
*This JavaPOS Driver supports to control the Serial and USB Interface Printer and of at most two drawers each, connected to one printer.
*Multiple numbers of interface and printers can be set to the driver. For details, refer to Chapter 7 "Using Multiple
Printers."
5
2) Terminology a. Device Control (DC)
According to each device class, it provides application with the set of the properties, methods, and events.
This Document explains these API. b. Device Service (Device Service; DS)
It executes the function which is called from Device Control and which is prescribed by JavaPOS for each device.
6
1.3. Restrictions
The following restrictions are applied:
1) POS Printer
[Restrictions on JavaPOS specifications]
1. All interface of the JavaPOS POS Printer Device are provided, but there are the following restrictions: a. b. c. d. e.
It does not support property setting concerning journal printing and journal.
It does not support property setting concerning slip printing and slip.
It does not support functions of Italic, custom color, shading printing, and cartridge.
It does not support change of receipt printing character font. (Printing font change)
The following methods always return JPOS_E_ILLEGAL(106) after enabling.
printTwoNormal Method
beginInsertion Method
endInsertion Method
beginRemoval Method
endRemoval Method
changePrintSide Method
markFeed Method
resetStatistics Method
retrieveStatistics Method
updateStatistics Method
2. For USB Interface connection, there are the following restrictions:
· The behavior to set the DeviceEnabled property = true to the same printer from the application running on other VM is not supported.
3. The behavior after recovering from Suspend/Stand by is not supported.
The Suspend/Stand by mode should not be used.
2) Drawer
[Restrictions of JPOS specifications JavaPOS]
1. All the interfaces of JPOS Drawer Device are provided, but there are the following restrictions. a. PowerNotify Property (Power source notifying function setting)
Setting is only for JPOS_PN_DISABLED(0) (Impossible to notify)and unchangeable. b. c.
PowerState Property (Power source state)
Only JPOS_PS_UNKNOWN(2000)(Unclear) is set.
DirectIO Method (Particular-to-Device function)
It is not supported. After enabling, it always returns JPOS_E_ILLEGAL(106). d. WaitForDrawerClose Method (Waiting for the drawer to close)
It is not supported. After enabling, it always returns JPOS_E_ILLEGAL(106).
7
e. f.
DirectIOEvent Event (Particular- to-Device event)
It is not supported.
DrawerOpened Property, StatusUpdateEvent Event
Status notification of the Drawer is available only when CapStatus is true and the driver is enabled (DeviceEnabled=true) for the printer connected to the drawer. In case these conditions are not met, the status of the drawer is not notified.
2. For USB Interface connection, there are the following restrictions:
· The behavior to set the DeviceEnabled property = true to the same printer from the application running on other VM is not supported.
3. The behavior after recovering from Suspend/Stand by is not supported.
The Suspend/Stand by mode should not be used.
[Restriction of Drawer Hardware Specifications]
It does not support the function to notify the drawer power source condition.
3) Restriction when Windows driver and JavaPOS driver are installed in the same system
Problems such as failure to print correctly from the JavaPOS driver may occur if the Windows driver and
JavaPOS driver are both installed in the same system.
In this case, it is recommended that you uninstall the driver that is not being used.
8
1.4. Connection Way to POS Printer
Set the POS Printer to the following settings (in gray highlight). Rest of the values can be set in the setting file attached with jpos.xml or the installer.
Memory Swith
No. Setting Item
1 POWER ON STATUS
Setting Contents
Set item with printer setup tool
2 RECEIVE BUFFER 4 KB
7
8
9
10
5
6
3
4
BUSY CONDITION
RECEIVE ERROR HANDLING
AUTO LINEFEED
DSR (#6) RESET
INT (#25) RESET
INT (#31) RESET
COVER OPEN ERROR
PROTOCOL
Bufferfull
Print ?
Not available at any time
Not available
Not available
Available
Auto Recover
XON/XOFF
7
8
3
4
5
6
Customize Value
No. Setting Item
1 USER NV MEMORY
2 GRAPHIC MEMORY
PAPER WIDTH
PRINT DENSITY
PRINTING COLOR
BLACK DENSITY ON TWO COLOR
MAX SPEED
LOW POWER
Setting Contents
192 KB
384 KB
Set item with printer setup tool
Set item with printer setup tool
Set item with printer setup tool
Set item with printer setup tool
Set item with printer setup tool
Set item with printer setup tool
9
Others
No. Setting Item
1 ACK PULSE WIDTH
2 ERROR RECOVERY
7
8
9
10
5
6
3
4
PROCESS ID
PNE DETECTION
FONT B
USB
BUTCH PRINT
ERROR ALERT
BUZZER INTERVAL
BUZZER REPETITION
Setting Contents
1 microsecond
Command
Normal
Set item with printer setup tool
Mode 1
Printer
Disable
*Set from the setting program
*Set from the setting program
*Set from the setting program
10
1.5. About install
For Windows:
See the "opinstall_win.txt" and install the JavaPOS according to it.
11
1.6. Setting Program Usage
Operation Conditions
This Java-POS must be installed.
Screen and function
Setting Program is executed as the following procedure.
1. Compile
>javac Setup.java
2. Execution
>java Setup
The following screen is displayed.
<< Serial interface setting screen >>
12
<< USB interface setting screen >>
Select serial number of printer from "Serial Number".
(Refer to "9. Serial number confirm method of printer" for serial number of printer.)
OK button becomes effective by selecting serial number.
When the Reload button is pushed, the serial number of the connected printer is reread, and displayed in “Serial
Number".
13
When an error occurred with OK button pushed, the following messages are displayed.
Confirm an error factor, and setup again.
<An error factor>
- A cable is not connected.
- The printer is not switched on.
- A cover opens.
- There is not paper.
- A port is already used in others.
- A communication condition does not accord with a printer. (Serial connection)
- Serial number input is wrong. (USB connection)
When the printer status is "error" and this setting program is executed, the setting is not reflected in the printer.
After confirming the setting, execute the setting program, and then follow the procedure again.
14
In case the "jpos.xml" file cannot be located when the setting program is executed, the following dialog is displayed.
Select the "jpos.xml" file from this dialog.
15
2. Using JavaPOS Driver
2.1. Common
The application uses the OPOS control in the steps as follows:
1. open method: Called to link the control object to the service object.
2. claim method: Called to enable exclusive access to the device. For the device of exclusive use, this method is required, and foe the device of sharable use, it is optional.
3. DeviceEnabled property: Set to true to operate the device.
4. Use the device. (Each property, method, event)
5. DeviceEnabled property: Set to false to disable the device.
6. release method: Called to clear exclusive access to the device.
7. close method: Called to release the service object from the control object.
2.2. POS Printer
The POS printer supports only "Receipt." For the methods and properties of other than that (Journal or Slip), interface is supplied but behavior is not supported.
According to the general output model, synchronous and asynchronous output is available for the POS printer.
The POS printer is the device to be used exclusively.
2.3. Drawer
The Drawer can be used in the same way as the POS printer, but all features are executable without executing the
claim method. However, when exclusive permission is acquired for particular application by the claim method, the
openDevice method cannot be executed by the application enabled with the same name. If there is no application with exclusive permission, this is not the case.
2.4. Notes
- When the application using this JavaPOS driver is started, you should set the New area of the memory to 10MByte or more. ( java command option -Xmn10m). When the New area is a little, the memory utilization might increase because a large amount of object generated with the communication is not liberated for a long term.
- If the JPOS_E_TIMEOUT is returned when you enable the application, increase and adjust the value of
ResetTimeout of jpos.xml (Refer to Chapter 5.3).
16
3. JavaPOS Interface Specifications (Printer)
3.1. List
Properties
Common Type Access May Use After Initial Value, Conditions
CapCompareFirmwareVersion boolean R open true
CapPowerReporting
CapStatisticsReporting
CapUpdateFirmware
CapUpdateStatistics
CheckHealthText
Claimed
DeviceEnabled
FreezeEvents boolean R open boolean R open boolean R open boolean R/W open & claim open open false true boolean R open false
String R "" false false false
Made writable after open.
OutputID
PowerNotify
Made writable after open, and unwritable after enabled.
PowerState
State
DeviceControlDescription
DeviceControlVersion
DeviceServiceDescription
String R ---
(2000) int R 1
"POS Printer JavaPOS
Device Control" int R 1010XXX
String R open "POS Printer JavaPOS
Device Service"
DeviceServiceVersion
PhysicalDeviceDescription String R open
PhysicalDeviceName String R open
"OP 1 Station Thermal
POSPrinter"
"OP 1 Station Thermal
POSPrinter "
17
Specific
CapCharacterSet
CapConcurrentJrnRec
CapConcurrentJrnSlp
CapConcurrentPageMode
CapConcurrentRecSlp
CapCoverSensor
CapMapCharacterSet
CapTransaction
CapJrnPresent
CapJrn2Color
CapJrnBold
CapJrnDhigh
CapJrnDwide
CapJrnDwideDhigh
CapJrnEmptySensor
CapJrnItalic
CapJrnNearEndSensor
CapJrnUnderline
CapJrnCartridgeSensor
CapJrnColor
Specific
CapRecPresent
CapRec2Color
CapRecBarCode
CapRecBitmap
CapRecBold
CapRecDhigh
CapRecDwide
CapRecDwideDhigh
CapRecEmptySensor
CapRecItalic
CapRecLeft90
Type Access May Use After
Initial Value,
Conditions boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open false false false false true true true false false false false false false false false false false
Type Access May Use After Initial Value, Condition boolean R open boolean R open true
The initial value may vary according to the contents of jpos.xml. boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open true true true true true true true false true
18
CapRecMarkFeed
Specific
CapRecNearEndSensor
CapRecPapercut
CapRecRight90
CapRecRotate180
CapRecStamp
CapRecUnderline
CapRecCartridgeSensor
CapRecColor
CapRecMarkFeed
CapRecPageMode
Specific
CapSlpPresent
CapSlpFullslip
CapSlp2Color
CapSlpBarCode
CapSlpBitmap
CapSlpBold
CapSlpDhigh
CapSlpDwide
CapSlpDwideDhigh
CapSlpEmptySensor
CapSlpItalic
CapSlpLeft90
CapSlpNearEndSensor
CapSlpRight90
CapSlpRotate180
CapSlpUnderline
CapSlpBothSidesPrint
CapSlpCartridgeSensor
CapSlpColor
CapSlpPageMode
Type boolean
Access May Use After Initial Value, Condition
R open The initial value may vary according to the contents of jpos.xml. boolean R open boolean R open boolean R open boolean R open boolean R open true true true false true int
R open int
R open boolean R open
0
0 false
Type Access May Use After Initial Value, Condition boolean R open boolean R open false false boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open boolean R open false false false false false false false false false false false false false false boolean R open false boolean R open false
19
Specific
AsyncMode
Type Access May Use After Initial Value, Condition open open false
Made writable after enabled
CartridgeNotify
CharacterSet
CharacterSetList
Unwritable open, 998
& Enable Made writable after enabled
String R open "101,102,103,437,850,851,852
,857,858,860,863,864,
865,866,869,932,998,1252,28
592,28597"
CoverOpen
& Enable
ErrorLevel
ErrorStation
ErrorString
FontTypefaceList
FlagWhenIdle
String R open ""
String R open "" false
Made writable after enabled true MapCharacterSet
MapMode
PageModeArea
PageModeDescriptor
String R open
Made writable after open
""
PageModeHorizontalPosition int R
PageModePrintArea
PageModePrintDirection
String R/W ""
PageModeStation
PageModeVerticalPosition
RotateSpecial
Made writable after open
Specific
JrnLineChars
JrnLineCharsList
JrnLineHeight
JrnLineSpacing
Type Access May Use After Initial Value, Condition open, 0
& Enable Unwritable
String R open "" open, 0
& Enable Unwritable open, 0
& Enable Unwritable
20
Specific
JrnLineWidth
JrnLetterQuality
JrnEmpty
JrnNearEnd
JrnCartridgeState
JrnCurrentCartridge
Specific
RecLineChars
Type
Type
RecLineCharsList
RecLineHeight
RecLineSpacing
RecLineWidth
RecLetterQuality
RecEmpty
RecNearEnd
RecSidewaysMaxLines
RecSidewaysMaxChars int
String
Access May Use After Initial Value, Condition open, 0
& Enable
& Enable Unwritable
& Enable
& Enable open, 0
& Enable open, 0
& Enable Unwritable
Access May Use After Initial Value, Condition open, The initial value may vary
& Enable according to the jpos.xml contents.
Made writable after open.
R open The initial value may vary according to the jpos.xml contents. open, The initial value may vary
& Enable according to the jpos.xml contents.
Unwritable
& Enable
The initial value may vary according to the jpos.xml contents.
Made writable after open. open, The initial value may vary
& Enable according to the jpos.xml contents.
R
21
& Enable
& Enable
Made writable after open.
& Enable open, The initial value may vary
& Enable according to the jpos.xml contents. open, claim The initial value may vary
Specific
RecLinesToPaperCut
Type Access May Use After Initial Value, Condition
& Enable according to the jpos.xml contents. open, The initial value may vary
& Enable according to the jpos.xml contents.
String R open "0,R90,L90,180" RecBarCodeRotationList
RecCartridgeState
RecCurrentCartridge
RecBitmapRotationList
Specific
SlpLineChars
Unwritable
String R open "0"
Type Access May Use After Initial Value, Condition
Unwritable
SlpLineCharsList
SlpLineHeight
SlpLineSpacing
SlpLineWidth
SlpLetterQuality
SlpEmpty
SlpNearEnd
SlpSidewaysMaxLines
SlpSidewaysMaxChars
SlpMaxLines
SlpLinesNearEndToEnd
SlpBarCodeRotationList
SlpPrintSide open
& Enable open, 0
& Enable Unwritable
& Enable
0
Unwritable open, 0
& Enable claim false
& Enable Unwritable boolean R open, false
& Enable boolean R open, false
& Enable open, 0
& Enable open, 0
& Enable open, 0
& Enable open, 0
& Enable
String R open "" open, 0
& Enable
22
Specific
SlpCartridgeState
SlpCurrentCartridge
SlpBitmapRotationList
Type Access May Use After Initial Value, Condition open, PTR_CART_UNKNOWN
& Enable
(268435456) open, 0
& Enable Unwritable
String R open ""
* In the Access column, R indicates Read-Only, R/W indicates Read/Write. The item in May Use After is the method and property required for initialization, open indicates the open method, claim indicates the claim method and Enable indicates setting the DeviceEnabled property to true. If required procedure is not executed, JposException may be notified. For the property with open & claim or open, claim & Enable in May Use After, it is available for acquisition after the open method is executed, but the value may not be initialized until all open, claim & Enable are executed. To acquire such property, access it after the conditions are met.
Methods
Common Initialization open close none open claim release clearOutput checkHealth compareFirmwareVersion directIO resetStatistics retrieveStatistics updateFirmware updateStatistics open open & claim open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable
Specific printNormal printTwoNormal printImmediate beginInsertion endInsertion beginRemoval endRemoval open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable
Initialization
23
Specific cutPaper rotatePrint printBarcode printBitmap transactionPrint validateData setBitmap setLogo changePrintSide markFeed clearPrintArea pageModePrint printMemoryBitmap
Events
DirectIOEvent
ErrorEvent
Event
OutputCompleteEvent
StatusUpdateEvent open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable
Initialization open, claim & Enable open, claim & Enable open, claim & Enable open, claim & Enable
Initialization
24
3.2. Print Data and Escape Sequences
This POS printer supports the following escape sequences.
1) Escape Sequence which operates only when assigned time.
Name Data Remarks
Paper cut ESC |#P Cuts receipt paper. The character '#' is replaced by the character string of ASCII decimal string telling the percentage of required cutting. It is possible to omit '#'.
When the value is between '1' to '99', partial cutting is performed. When the value is '100' or omitted, full cutting is performed. When the value is other than any value between '1' to '100', it is ignored However, if data has been buffered at the POS Printer, that is, the print request is enqueued, but not printed on the POS Printer, a papercut is not allowed. A papercut is performed at the beginning of the line.
It is unavailable in 90 degrees rotating to the left or to the right by RotatePrint Method, and back in operation after clearing 90 degrees rotating to the left or to the right.
Feed and Paper cut ESC |#fP Cuts receipt paper, after feeding the paper by the
RecLinesToPaperCut lines. The character '#' is defined by the "Paper cut" escape sequence. However, if data has been buffered at the POS Printer, that is, print request is enqueued, but not printed on the POS
Printer, a papercut is not allowed. A papercut is performed at the beginning of the line.
It is unavailable in 90 degrees rotating to the left or to the right by RotatePrint Method, and back in operation after clearing 90 degrees rotating to the left or to the right.
Not supported. Feed, Paper cut, and
Stamp
Print bitmap
ESC |sP
ESC |#B
Print top logo
Print bottom logo
Print stamp
ESC |tL
ESC |bL
ESC |sL
Prints the bitmap stored with the setBitmap method. '#' is the Bitmap number and supports 20 bitmap printing
'1' to '20'. It is possible to change printing quality by changing RecLetterQuality property value in printing.
As for handling printing quality, it is same as
PrintBitmap Method. When '#' is omitted, it is handled as character string.
When '#' is omitted, it is regarded character string data starting with the character "B".
When the number that is not stored in the SetBitmap method, the print command is issued to the printer, but printing is not performed.
Prints the top logo stored by the setLogo method.
Prints the bottom logo stored by the setLogo method.
Not supported.
25
Name
Feed lines
Feed units
Feed reverse
Data
ESC |#lF
ESC |#uF
ESC |#rF
Remarks
Feeds the paper forward by lines. The character '#' is replaced by an ASCII decimal string telling the number of lines to be fed. If '#' is omitted, then one line is fed.
'#' supports the values from '1' to '255'.
If print data is not presence, line feed operation is executed according to the amount of line feed, and if print data is presence, the height of the print data is fed.
If the value specified for "#" exceeds 35.4 in (approx.
900 mm), the command is executed feeding the paper by 35.4 in (approx. 900 mm)
In 90 degrees rotating to the left or to the right by
RotatePrint Method, it prints next printing location after
Returns of feed-assigned lines.
Feeds the paper forward by the units defined with
MapMode. The character '#' is replaced by an ASCII decimal string telling the number of units to be fed. If
'#' is omitted, then one unit is fed.
MapMode = PTR_MM_DOTS(1)
'#' supports the values from '1' to '127'. (If the value is smaller than '1', the command is not executed, and if the value is larger than '127', the command is executed regarding that '127' is assigned.)
MapMode = PTR_MM_TWIPS(2)
'#' supports the values from '1' to '903'. (If the value is smaller than '1', the command is not executed, and if the value is larger than '903', the command is executed regarding that '903'is assigned.)
MapMode = PTR_MM_ENGLISH(3)
'#' supports the values from '1' to '627'. (If the value is smaller than '1', the command is not executed, and if the value is larger than '627', the command is executed regarding that '627'is assigned.)
MapMode = PTR_MM_METRIC(4)
'#' supports the values from '1' to '1594'. (If the value is smaller than '1', the command is not executed, and if the value is larger than '1594', the command is executed regarding that '1594'is assigned.)
The line feed setting of the printer does not affect the amount of line feed.
It is executed on the halfway of the line, and when the specified amount of line feed is less than 1 line, then 1 line is fed.
In 90 degrees rotating to the left or to the right by
RotatePrint Method, it prints next printing location after
Returns of feed-assigned lines.
Not supported.
26
Name
Send embedded data
Barcode printing
(Refer to the next page)
Data
ESC |#E
ESC |#R
Remarks
The successive character string of "#E" is passed to the device without any change. The character '#' is replaced by an ASCII decimal string specifying the number of bytes following the escape sequence to be passed directly to the device. If '#' is omitted, it is not regarded as the escape sequence, and handled as print data.
When the print data specified by '#' is not set after the escape sequence is specified, available print data is sent.
(Example: When ESC|2E"a" is specified, only "a" is sent because the character string is set only for one byte.)
In rotate printing 90 degrees to the left or to the right by the RotatePrint method, the data column specified by
Send embedded data is not counted as the character string, the width cannot be calculated. Adjust the printing width by inserting empty space and so on.
The maximum length of the character string that is supported is the maximum value of int (2147483647)
The codes "80H" to "FFH" cannot be printed as properly.
Prints the barcode. The character ‘#’ is replaced by an
ASCII decimal string and the number of characters following the R to use in the definition of the characteristics of the barcode to be printed. See details below.
The barcode may be printed during rotate printing 90 degrees to the left or to the right by the RotatePrint method, but printing may not be performed normally because the print area is not calculated by the specified barcode width. When the other character string data specified exceeds the barcode width, printing is executed.
The available width that can be set by the parameter is up to the value of the RecLineWidth property and is not affected by the RotateSpecial property. a t h w d
The application can use the ESC|#R escape sequence to print barcodes. The character ‘#’ is the number of characters following the R to use in the definition of the characteristics of the barcode to be printed.
With the character string following the R, the lower case letters and numbers are used to specify the characteristics of the barcode. As the value, the constant defined for the printBarCode method can be used.
The attribute symbols are defined as follows: s symbology (type of the barcode) height (the height of the barcode) width (the width of the barcode) alignment (the position of the barcode) human readable text position (the position of the HRI character string) start of data
27
e end of data
The attributes must appear in the order specified in the above list. (It cannot be omitted)
Using a basic UPCA, center aligned, with bottom text, 200 dots height and 400 dots wide, the command is as follows:
ESC|33Rs101h200w400a-2t-13d123456789012e
The followings are excerption of the definitions of the constants used in the example above from the header file. public static final int PTR_BCS_UPCA = 101; // Digits public static final int PTR_BC_CENTER = -2; public static final int PTR_BC_TEXT_BELOW = -13;
Threshold of the each parameter is as follows. When the value exceeds the threshold, the barcode is not printed.
Barcode Width (dot) Height (dot) Alighnment
Other than 2D barcode Minimu width of the 1 to 255 barcode to
RecLineWidth
Any value defined by the printBarcode method can be set.
PDF417 172 to RecLineWidth 12 to 831
PDF417
With the rotatePrint method rotated 90 degree right or left.
172 to 831 12 to RecLineWidth
Any value defined by the printBarcode method can be set.
Regardless the value specified, all aligned left.
2) Escape Sequence which operates during printing
It has characteristics that are remembered until explicitly changed
Name Data Contents
Font typeface selection ESC |#fT Not supported.
3) Escape Sequence which operates at the time of printing
It has the characteristics that are reset at the end of each print method or by a "Normal" sequence."
Name Data Remarks
Bold ESC |(!)bC Prints in bold.
When "!" is specified, the bold is not valid.
Underline ESC |#uC
Italic
Alternate color (Custom)
ESC |(!)iC
ESC |#rC
Prints with underline. The character '#' is replaced by an ASCII decimal string telling the thickness of the underline in printer dot units.
Underlines in 1 dot and 2 dots are supported. If '#' is omitted, underline in 1 dot will be printed.
Not supported.
Not supported.
28
Name
Red
Data
ESC |rC
Remarks
Prints with the second color of the receipt.
Printing is possible only when "Printing Color" of Printer
Setting is "Two Colors".
When Color = mono is set in jpos.xml, printing is not affected by specifying this escape sequence.
Shading
Single high & wide
Double wide
Double high
ESC |#sC
ESC |1C
ESC |2C
ESC |3C
When "!" is specified, the bold is not valid.
Not supported.
Prints normal size.
Prints double-wide characters.
Prints double-high characters.
Double high & wide
Scale horizontally
Scale vertically
ESC |4C
ESC |#hC
ESC |#vC
Prints double-high/double-wide characters.
Prints with the width scaled '#' times the normal size, where '#' is replaced by an ASCII decimal string. 1 to 8 times are supported.
Prints in same size when '#' is omitted.
Prints with the height scaled '#' times the normal size, where '#' is replaced by an ASCII decimal string. 1 to 8 times are supported.
Prints in same size when '#' is omitted.
RBG Color
Center
Right justify
ESC |#fC
ESC |cA
ESC |rA
Not supported.
Aligns following text in the center. It is available only when it is specified at the beginnng of the line.
It is unavailable in 90 degrees rotating to the left or to the right by the RotatePrint method.
Aligns following text at the right. It is available only when it is specified at the beginnng of the line.
It is unavailable in 90 degrees rotating to the left or to the right by the RotatePrint method.
Normal ESC characteristics to normal condition. Centering or Align Right cannot be cleared unless it is specified at the beginning of the line.
SubScript ESC |(!)tbC Not supported.
SuperScript ESC |(!)tpC Not supported.
29
3.3. Common Properties
The following sections describe the properties provided commonly to the POS printer.
There are two kinds of properties: Read-Only and Read/Write. For the property that is is writable, R/W is added next to the property name.
Only when exception's errorCode has the special meaning, the description is provided.
CapCompareFirmwareVersion Property
Type boolean
Remarks
Errors
If TRUE, then the Service/device supports comparing the version of the firmware in the physical device against that of a firmware file.
This property is initialized to true by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapPowerReporting Property
Type int
Remarks Identifies the reporting capabilities of the device. It has one of the following values:
Errors
Value Meaning
JPOS_PR_STANDARD (1) The Device Service can determine and report two of the power states – OFF_OFFLINE (that is, off or offline)
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
30
CapStatisticsReporting Property
Type
boolean
Remarks
Errors
This property is initialized to false by the open method. Statistics reporting is not supported.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapUpdateFirmware Property
Type boolean
Remarks This property is initialized to true by the open method. The device’s firmware can be updated.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapUpdateStatistics Property
Type boolean
Remarks This property is initialized to false by the open method. Statistics reporting is not supported.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
31
CheckHealthText Property
Type String
Remarks
Errors
Holds the results of the most recent call to the checkHealth method. The following examples illustrate some possible diagnoses:
- In case of Internal "Internal HCheck: Successful", "Internal HCheck: OFF/OFFLINE"
- In case of External "External HCheck: Not Supported"
- In case of Interactive "Interactive HCheck: Not Supported"
This property is initialized to an empty string ("") before the first call to the checkHealth method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
Claimed Property
Type boolean
Remarks
Errors
true: The device is claimed for exclusive access.
false: The device is released for sharing with other applications.
The value of the Claimed property is initialized to false by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
DeviceControlDescription Property
Type String
Remarks "JavaPOS POSPrinter Device Control" is set. (The value may vary depending on the DC in use.)
Identifies the Device Control. It is a character string identifying the Device Control and the company that produced it and always readable.
Errors None.
32
DeviceControlVersion Property
Type int
Remarks "1010XXX" is set. Holds the Control Object version number. Three version levels are specified, as follows:
Errors None.
PhysicalDeviceDescription
Type String
Remarks
Version Level
Major
Description
The "millions" place.
Holds the OPOS major version level.
Minor
Build
The "thousands" place.
Holds the OPOS minor version level. This is always set to 10 since this OPOS control conforms to OPOS version 1.10.
The "units" place. Updated when corrections are made to the
Control Object.
This property is always readable. (XXX varies depending on the time the Control Object is distributed.)
Errors
"OP 1 Station Thermal POS Printer." is set.
It is a character string identifying the device and holds the device name and related information.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
33
DeviceEnabled Property R/W
Type boolean
Remarks
Errors
true: The device is enabled and in an operational state. If changed to true, then the device is brought to an operational state.
false: The device has been disabled. If it is changed to false, then the device is physically disabled.
Before the device is used, application must set this property true.
Also, while DeviceEnabled is true, Device Connection State (PowerReporting) is reported. This property is initialized to false by the open method.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_NOHARDWARE (107) POS Printer is OFF or OFFLINE or the cable is not connected.
Clear the problem, and then execute the property again.
JPOS_E_FAILURE (111) The connection to the device is failed. There is the possibility that the port specified does not exist.
JPOS_E_TIMEOUT (112)
JPOS_E_BUSY (113)
Connection to the POS Printer could not be established. Or the
POS Printer could not be replaced.There is the possibility of cover open or running out of paper.
An error occurred during setting the property because the processing is in progress. Set the property after the processing is completed.
PhysicalDeviceName Property
Type String
Remarks
Errors
"OP 1 Station Thermal POSPrinter" is set.
Holds the device name and related information.. This is a short version of
PhysicalDeviceDescription and should be limited to 30 characters.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
34
FreezeEvents Property R/W
Type boolean
Errors
If false, the application allows events to be delivered. If some events have been held while events were frozen during true and all other conditions are correct for delivering the events, then changing this property to false will allow these events to be delivered. An application may choose to freeze events for a specific sequence of code where interruption by an event is not desirable.
This property is initialized to false by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
OutputID Property
Type int
Remarks
Errors
Holds the identifier to identify the asynchronous request (call to the method which corresponds asynchronously when the AsyncMode property is set to true) uniquely.
When an output method successfully starts asynchronous or synchronous output, the JavaPOS
Driver assigns an identifier to the request. When the asynchronous output completes, an
OutputCompleteEvent will be enqueued with this output ID as a parameter.
The OutputID property is assigned to a value based on a circular numbering system among the values from 1 through 65535.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
35
PowerNotify Property R/W
Type int
Remarks Contains the type of power notification selection made by the application.
The value to indicate the power notification feature is one of the followings:
Errors
Value Meaning
JPOS_PN_DISABLED (0) The Driver will not provide any power notifications to the application. No power notification StatusUpdateEvents will be fired, and PowerState may not be set.
(Default value)
JPOS_PN_ENABLED (1) The Driver will fire power notification StatusUpdateEvents and update PowerState, when DeviceEnabled is set to true.
PowerNotify may only be accessed while the device is disabled; that is, while DeviceEnabled is
false.
This property is initialized to JPOS_PN_DISABLED(0) by the open method.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106) Either of the follwings occurred.
- The device was already enabled.
- The setting value of the property was illegal.
36
PowerState Property
Type int
Remarks Specifies the current power condition of the device while PowerNotify is JPOS_PN_DISABLED
(0). The value to indicate the power condition is one of the followings:
Errors
Value Meaning
JPOS_PS_UNKNOWN (2000) The device's power state cannot be determined for one of the following reasons (Default value):
PowerNotify = JPOS_PN_DISABLED (0); power notifications are disabled.
DeviceEnabled = false;
Power state monitoring does not occur until the device is enabled.
JPOS_PS_ONLINE (2001) The device is powered on and ready.
JPOS_PS_OFF_OFFLINE (2004)
The device is not powered on or not connected to the system.
This property is initialized to JPOS_PS_UNKNOWN (2000) by the open method. When
PowerNotify is set to JPOS_PS_ENABLED (1) and DeviceEnabled is true, then this property is updated as the power condition change is detected.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
DeviceServiceDescription Property
Type string
Remarks
Errors
"POS Printer JavaPOS Device Service " is set.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
37
DeviceServiceVersion Property
Type string
Remarks
Errors
"1010XXX" is set. Holds the Device Service version number. (XXX varies depending on the time the Device Service is distributed)
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
State Property
Type int
Remarks Holds the current state of the driver.
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed driver. (Default)
JPOS_S_IDLE (2)
JPOS_S_BUSY (3)
JPOS_S_ERROR (4)
The driver is in a good state and is not busy.
The driver is in a good state and is busy performing output.
An error has been reported, and the application must recover the driver to a good state before normal I/O can resume.
This property is always readable.
Errors None.
38
3.4. Common Method
The following sections describe the methods provided commonly to the POS printer.
checkHealth Method
Syntax void checkHealth (int level) throws JposException;
The level parameter indicates the type of health check to be performed on the device. The following values may be specified:
Remarks
Errors
Value Meaning
JPOS_CH_INTERNAL (1) Performs an online check. The result will be set to the
CheckHealth property as follows:
- If the POS printer is connected to POS and power is on,
"Internal HCheck: Successful" is specified.
- If the POS printer is not connected to POS or power is not on,
"Internal HCheck: OFF/OFFLINE" is specified.
JPOS_CH_EXTERNAL (2) This parameter is not supported. "External HCheck: Not
Supported" is specified for the CheckHealthText property.
JPOS_CH_INTERACTIVE (3) This parameter is not supported. "Interactive HCheck: Not
Supported" is specified for the CheckHealthText property.
This method is called to test the state of the device. The result of the method is stored in the
CheckHealthText property. The CheckHealthText property is always synchronous.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed for exclusive access before it can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
JPOS_E_BUSY (113)
This operation cannot be performed while the device is disabled.
The specified level parameter is not supported.
This operation cannot be performed while processing is in progress.
39
claim Method
Syntax
Remarks
Errors
void claim (int timeout) throws JposException;
The timeout parameter gives the maximum number of milliseconds to wait for exclusive access to be satisfied. If it is zero (0), then the method immediately returns the result even if acquisition of exclusive access fails/
If JPOS_FOREVER (-1) is set, the method waits as long as needed until exclusive access is satisfied.
This method is called to request exclusive access to the device.
The POS printer cannot be used unless exclusive access is obtained.
When successful, the Claimed property is changed to true.
When the claim method is executed, the connection with the POS printer device is established, and it is confirmed to process it. If it is possible to process it, fixed data is requested, and the claim method finishes normally. Exclusive control by the claim method is effective only between application programs on same VM.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106)
JPOS_E_TIMEOUT (112)
An invalid timeout parameter was specified.
Another application has exclusive access to the device, and did not relinquish control before timeout milliseconds expired.
40
clearOutput Method
Syntax void clearOutput () throws JposException;
Remarks
Errors
This method is called to clear all device output that is buffered by issuing the printNormal,
cutPaper, rotatePrint, printBarCode, printBitmap, transactionPrintdata method asyncrounously. Released the rotate mode or batch transaction print mode by the rotatePrint nethod or the transactionPrint method.
Any output error events that are enqueued – usually waiting for FreezeEvents to be set to false – are also cleared.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
close Method
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103)
An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_FAILURE (111)
This operation cannot be performed while the device is disabled.
The device is accessed exclusively by other process.
Syntax void close () throws JposException;
Remarks
Errors
Releases the device and its resources.
If the DeviceEnabled property is true, then the device is disabled.
If the Claimed property is true, then exclusive access to the device is released.
This method should not be excuted while the event is being processed (in the event handler).
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_BUSY (113) Asyncrounous processing is in progress.
41
compareFirmwareVersion Method
Syntax void compareFirmwareVersion(String firmwareFileName, int[] result) throws JposException
Remarks
Errors
Parameter Description
FirmWareFileName Holds the name of the firmware file whose version is to be compared against the firmware version of the device.
result Returns the result of the comparison.
JPOS_CFV_FIRMWARE_OLDER (1)
Indicates that the version of one or more of the firmware files is older than the firmware in the device.
JPOS_CFV_FIRMWARE_SAME(2)
Indicates that the versions of all of the firmware files are the same as the firmware in the device.
JPOS_CFV_FIRMWARE_NEWER(3)
Indicates that the version of one or more of the firmware files is newer than the firmware in the device.
JPOS_CFV_FIRMWARE_UNKNOWN(5)
Indicates that a relationship between the two firmware versions could not be determined
This method determines whether the version of the firmware contained in the specified file is newer than, older than, or the same as the version of the firmware in the POS printer.
The version of the firmware is represented by the value of first six successive numbers found in the
FirmWareFileName parameter. Foe example, when "01rm012345.hx1" is set in the
FirmWareFileName parameter, "012345" is recognized as the version of the firmware file to be compared. The version of the POS printer can be acquired by sending the command to the POS printer every time this method is executed.
In the first step of comparison, first four places in the version acquired from the POS printer and first four places in the version of the firmware file are compared as the character strings. When those are different, JPOS_CFV_FIRMWARE_UNKNOWN(5) is set in the result parameter.
When the first four places are equal, then last two places are compared as the values. When the version of the firmware file is smaller, JPOS_CFV_FIRMWARE_OLDER (1) is set. When the version of the POS printer is smaller, JPOS_CFV_FIRMWARE_NEWER(3) is set. When those are equal, JPOS_CFV_FIRMWARE_SAME(2) is set.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL(106)
This operation cannot be performed while the device is disabled.
Specified argument is invalid as the firmware file name.
42
JPOS_E_FAILURE (111)
JPOS_E_BUSY (113)
Comparison of the version was failed.
This operation cannot be performed while processing is in progress.
43
directIO Method
Syntax void directIO (int command, int[] data, Object object) throws JposException;
Parameter Description
data An array of one modifiable integer. It is not used.
Remarks
Errors
Sends the data in specified bytes asynchronously or synchronously when command = 0
(JPOS_FIT_DIO_BIN), and object is set to java.io.ByteArrayOutputStream.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103)
An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
This method is not supported.
JPOS_E_NOHARDWARE (107)
The POS printer is not connected to the system or is not powered on.
JPOS_E_BUSY (113) This operation cannot be performed during the error (State =
JPOS_S_ERROR(4)). This operation cannot be performed while processing is in progress.
ErrorCodeExtended
= JPOS_EPTR_COVER_OPEN (201):
The POS printer cover is open.
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_REC_EMPTY (203):
The receipt station is out of paper.
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_FATAL (10003):
A non-recoverable error occurred.
(Can be returned only if AsyncMode is false.)
44
ErrorCodeExtended =
JPOS_FIT_EPTR_OVERHEAT (10006):
The print head is overheated.
(Can be returned only if AsyncMode is false.)
open Method
Syntax void open(String logicalDeviceName) throws JposException;
The logicalDeviceName parameter specifies the device name to open.
Specify one of the following values according to interface of the POS printer to connect:
- Serial Interface "PT390SERPRT","PT390SER2PRT"
- USB Interface "PT390USBPRT","PT390USB2PRT"
Remarks
Errors
This menotd is called to open a device.
When the open method is successful, the Claimed, and DeviceEnabled properties and other properties are initialized.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_NOSERVICE (104) A connection to the corresponding Device Service could not be established.
JPOS_E_ILLEGAL (106) The Device Driver is already open.
release Method
Syntax void release () throws JposException;
Remarks
Errors
This method is called to release exclusive access to the device.
If the DeviceEnabled property is true and the device is an exclusive-use device, then the device is also disabled.
This method should not be excuted while the event is being processed (in the event handler)..
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106)
JPOS_E_BUSY (113)
Exclusive access to the device is not allowed for the application.
This operation cannot be performed while processing is in progress.
resetStatistics Method
Syntax void resetStatistics() throws JposException;
45
Remarks
Errors
This method is not supported.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103)
An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
This method is not supported.
retrieveStatistics Method
Syntax void retrieveStatistics() throws JposException;
Remarks
Errors
This method is not supported.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103)
An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
This method is not supported.
46
updateFirmwareMethod
Syntax void updateFirmware(String firmwareFileName) throws JposException
Remarks
Parameter Description
FirmwareFileName Specifies either the name of the file containing the firmware or a file containing a set of firmware files that are to be downloaded into the device..
This method updates the firmware of a device with the version of the firmware contained or defined in the file specified by the FirmwareFileName parameter regardless of whether that firmware’s version is newer than, older than, or the same as the version of the firmware already in the device.
When this method is invoked, the Service Object should check that the specified firmware file exists.
If so, this method should return immediately and the remainder of the update firmware process should continue asynchronously. The Service Object should notify the application of the status of the update firmware process by firing StatusUpdateEvents with values of
JPOS_SUE_UF_PROGRESS(2100) + an integer between 1 and 100 indicating the completion percentage of the update firmware process. For application convenience, the StatusUpdateEvent value JPOS_SUE_UF_COMPLETE(2200) is defined to be the same value as
JPOS_SUE_UF_PROGRESS(2100) + 100. If an error is detected during the asynchronous portion of an update firmware process, one of the following StatusUpdateEvents will be fired:
After downloading the firmware to the POS printer, when the firmware version acquired from the file name and the version acquired from the POS printer are compared (same processing as the
CompareFirmware method). If inconsistency is found, JPOS_SUE_UF_FAILED_DEV_OK(2201) is notified instead of JPOS_SUE_UF_COMPLETE(2200).
Value Meaning
JPOS_SUE_UF_FAILED_DEV_OK(2201)
The update firmware process failed but the device is still operational.
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103)
An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_NOEXIST(109)
JPOS_E_BUSY (113)
This operation cannot be performed while the device is disabled.
The file specified by FirmwareFileName does not exist
This operation cannot be performed during the error (State =
JPOS_S_ERROR(4)). This operation cannot be performed while processing is in progress.
47
The specified firmware file or files exist, but one or more are either not in the correct format or are corrupt.
(When the extension is other than "hx1", this error occurs)
updateStatistics Method
Syntax void updateStatistics() throws JposException;
Remarks
Errors
This method is not supported.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103)
An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
This method is not supported.
48
3.5. Specific Properties
AsyncMode Property R/W
Type boolean
Remarks
Errors
true: The print methods printNormal, cutPaper, rotatePrint, printBarCode, printBitmap,
transactionPrint and directIO will be performed asynchronously.
false: Those methods will be performed synchronously.
This property is initialized to false by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapCharacterSet Property
Type int
Remarks
Errors
It shows printable character setting of the PS printer.
This property has one of the following values
Value Meaning
PTR_CCS_KANJI (11) Character setting supports code page 932. It supports single-byte katakanas from 0xA1 to 0xDF, and all the ASCII characters from 0x20 to 0x7F. Also, it supports the Sift JIS Code characters which are defined by the first JIS standard level and the second
JIS standard level.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
49
CapCoverSensor Property
Type boolean
Remarks true: The POS printer has a "cover open" sensor.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapMapCharacterSet Property
Type boolean
Remarks
Errors
true: The Device Service is able to map the characters to the character sets defined in the
CharacterSetList property.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRec2Color Property
Type boolean
Remarks true: The receipt can print dark plus an alternate color.
false: The receipt does not support printing dark plus an alternate color.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
50
CapRecBarCode Property
Type boolean
Remarks true: The receipt can print bar code.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecBitmap Property
Type boolean
Remarks true: The receipt can print bitmaps.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecBold Property
Type boolean
Remarks true: The receipt can print bold characters.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
51
CapRecCartridgeSensor Property
Type int
Remarks
Errors
This property is "0". Receipt Cartridge monitoring sensors are not loaded.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecColor Property
Type int
Remarks
Errors
This property is "0". The receipt does not support the capability to print in color.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecDhigh Property
Type boolean
Remarks true: The receipt can print double high characters.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
52
CapRecDwide Property
Type boolean
Remarks true: The receipt can print double wide characters.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecDwideDhigh Property
Type boolean
Remarks true: The receipt can print double high/wide characters.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecEmptySensor Property
Type boolean
Remarks true: The receipt has an out-of-paper sensor.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
53
CapRecItalic Property
Type boolean
Remarks false: The receipt cannot print italic characters.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecLeft90 Property
Type boolean
Remarks true: The receipt can print in a rotated 90 degree left mode.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecMarkFeed Property
Type int
Remarks
Errors
0: The receipt does not have the mark sensed paper handling capability.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
54
CapRecNearEndSensor Property
Type boolean
Remarks true: The receipt has a low paper sensor.
false: The low paper sensor does not work.
This property is initialized by the open method and it is set to either true or false according to the if prop name = PNESense setting in in the XML file.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecPageMode Property
Type boolean
Remarks
Errors
false: The printer is not capable of supporting Page Mode for the receipt station.
This property is initialized by the open method
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecPapercut Property
Type boolean
Remarks true: The receipt can perform paper cuts.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
55
CapRecRight90 Property
Type boolean
Remarks true: The receipt can print in a rotated 90 degree right mode.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecRotate180 Property
Type boolean
Remarks true: The receipt can print in a rotated upside-down mode.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapRecStamp Property
Type boolean
Remarks false: The receipt does not have a stamp capability.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
56
CapRecUnderline Property
Type boolean
Remarks true: The receipt can print underlined characters.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapTransaction Property
Type boolean
Remarks true: Batch processing of the POS Printer is valid.
This property is initialized by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CartridgeNotify Property R/W
Type int
Remarks
Errors
Contains whether cartridge state notification is available.
This property is specified by the application.
Value Meaning
PTR_CN_DISABLED(0) The device will not provide any cartridge state notifications to the application. No cartridge state notification
StatusUpdateEvents will be fired, and JrnCartridgeState,
RecCartridgeState, and SlpCartridgeState may not be set.
This property is initialized to PTR_CN_DISABLED(0) by the open method.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_ILLEGAL (106) This property cannot be set.
57
CharacterSet Property R/W
Type int
Remarks It sets up the characters for printing.
This property is initialized when Device is first enabled after the open method.
One of the following values is set up in this property.
Errors
Value Meaning
101 Selects MIK character set.
851
852
857
858
102
103
437
850
860
863
864
865
866
869
932
PTR_CS_ASCII (998)
1252
2859
28597
Selects PC866 (Cyrillic #2) character set.
Selects Thai code 18.
Selects PC437 (USA: Standard Europe) Character Set.
Selects PC850 (Multilingual) Character Set.
Selects PC851 (Greece - obsolete) Character Set.
Selects PC852 (Latin2) Character Set.
Selects PC857 (Turkish) Character Set.
Selects PC858 (Euro) Character Set.
Selects PC860 (Portuguese) Character Set.
Selects PC863 (Canadian-French) Character Set.
Selects PC864 (Arabic without BOX DRAWINGS below 20)
Character Set.
Selects PC865 (Nordic) Character Set.
Selects PC866 (Cyrillic #2) Character Set.
Selects PC869 (Greece) Character Set.
Selects Japanese Version Shift-JIS (Katakana) character set.
Sets up ASCII Character. It supports ASCII Characters from
0x20 to 0x7F. The constant value is 998.
Selects WPC1252 Character Set.
Selects ISO8859-2 (1999 Latin Alphabet No.2) Character Set.
Selects ISO8859-7 (1987 LatinGreek Alphabet) Character Set.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105) This operation cannot be performed while the device is disabled.
58
JPOS_ILLEGAL (106)
CharacterSetList Property
Type String
Remarks
Errors
The value other than above is specified.
Holds the character string of the character set number.
"101,103,437,850,851,852,857,858,860,863,864,865,866,869,932,998,1252,28592,28597" are set.
One of these values is set to the CharacterSet property by Installer.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CoverOpen Property
Type boolean
Remarks true: The printer cover is open.
false: The printer cover is closed.
This property is initialized when the device is enabled and updated to the current value while the device is enabled.
Errors This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
59
ErrorLevel Property
Type int
Remarks Holds the severity of the error condition. It has one of the following values:
Errors
Value Meaning
PTR_EL_NONE (1) No error condition is present.
PTR_EL_RECOVERABLE (2) A recoverable error has occurred (at the time of Cover Open
Error, Receipt End Error, Head Hot Error or Power
Discontinuity Error).
PTR_EL_FATAL (3) A non-recoverable error has occurred. (only in case of fatal error).
This property is set just before delivering an ErrorEvent for asynchronous printing. When the error is cleared, then the property is changed to PTR_EL_NONE (1).
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
ErrorStation Property
Type int
Remarks
Errors
Holds the POS printer (PTR_S_RECEIPT(2)) in printing when an error is detected.
This property is set up before ErrorEvent is notified.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
60
ErrorString Property
Type String
Remarks Holds the vender specific description of the current error.
This property is setby the driver just before delivering an ErrorEvent for asynchronous printing. If this description is not used, an empty string is set up in property. When the error is cleared, this property is chenged to an empty string.
The following wordings are set up by the POS Printer
Errors
Value Meaning
"Cover Open" The printer cover is open.
"Paper End"
"Head Hot"
The station is out of paper
The print head is overheated.
"Fatal Error"
"Power Off or Offline "
A non-recoverable error occurred.
The power is off (offline).
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
FlagWhenIdle Property R/W
Type boolean
Remarks
Errors
true: A StatusUpdateEvent will be enqueued when the device is in the idle state.
false: This event is not notified. If this status event is notified, FlagWhenIdle is automatically reset to false.
By utilizing Status Event with this property, Application can know the end of all the asynchronous output. When output ends successfully, or when output is deleted by the event handler which receives ErrorEvent, the event is notified.
If the State property is already JPOS_S_IDLE(2) when the FlagWhenIdle property is set to true,
StatusUpdateEvent is immediately notified. Thus, the application can use this event without worrying about the time difference between asynchronous output end and setting up of this flag.
This property is initialized to false by the open method.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
61
FontTypefaceList Property
Type String
Remarks
Errors
An empty string is set. It indicates that only the default typeface is supported.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
MapCharacterSet Property
Remarks
Errors
Indicates whether the device service map the character passed by the application for printing to the character set selected in the CharacterSet property. The driver map the character regardless whether
true or false.
This method is initialized to true by the open method.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
62
MapMode Property R/W
Type int
Remarks
Errors
Holds the mapping mode of the printer. The mapping mode defines the unit of measure used for other properties, such as line height and line spacing.
It supports the following map modes. The values inside the parentheses are the values calculated in dots per each unit:
Value Meaning
PTR_MM_DOTS (1) The printer's dot width. (1 dot)
PTR_MM_TWIPS (2)
PTR_MM_ENGLISH (3)
1/1440 of an inch. (7.0866 dots)
0.001 inch. (4.921 dots)
PTR_MM_METRIC (4) 0.01 millimeter. (12.5 dots)
Setting MapMode may also change RecLineHeight, RecLineSpacing and RecLineWidth.
This property is initialized to PTR_MM_DOTS (1) when the device is first enabled after the open method.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_ILLEGAL (106) An invalid mapping mode was specified.
PageModeArea Property
Type String
Remarks
Errors
It is initialized to "" (empty string) when the open method is excuted. The pageModePrint is not supported.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
63
PageModeDescriptor Property
Type int
Remarks It is initialized to 0 (zero) when the open method is excuted. The pageModePrint is not supported.
Errors This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
PageModeHorizontalPosition Property
Type int
Remarks It is initialized to 0 (zero) when the open method is excuted. The pageModePrint is not supported.
Errors This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
An invalid value was used. JPOS_ILLEGAL (106)
PageModePrintArea Property
Type String
Remarks
Errors
It is initialized to "" (empty string) when the open method is excuted. The pageModePrint is not supported.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_ILLEGAL (106) An invalid value was specified.
64
PageModePrintDirection Property
Type int
Remarks It is initialized to 0 (zero) when the open method is excuted. The pageModePrint is not supported.
Errors This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
An invalid value was specified. JPOS_ILLEGAL (106)
PageModeStation Property
Type int
Remarks It is initialized to 0 (zero) when the open method is excuted. The pageModePrint is not supported.
Errors This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_ILLEGAL (106)
PageModeVerticalPosition Property
An invalid value was specified.
Type int
Remarks It is initialized to 0 (zero) when the open method is excuted. The pageModePrint is not supported.
Errors This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_ILLEGAL (106) An invalid value was specified.
65
RecBarCodeRotationList Property
Type String
Remarks This character string shows the direction in which a receipt bar-code may be rotated. "0, R90, L90,
180" can be set.
This property is initialized by the open method. The character strings consist of groups of character strings separated by commas, and indicating rotation direction. The following show character strings which indicate rotation direction.
Errors
Value Meaning
0 Barcode may be printed in the normal orientation.
R90
L90
180
Barcode may be rotated 90° to the right.
Bar code may be rotated 90° to the left.
Barcode may be rotated 180° - upside down.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
RecBitmapRotationList Property
Type String
Remarks This character string shows the directions in which a receipt bitmap may be rotated. "0, R90, L90,
180" can be set.
This property is initialized by the open method. The string consists of rotation strings separated by commas. The following show character strings which indicate rotation direction:
Errors
Value Meaning
0 Bitmap may be printed in the normal orientation.
R90
L90
180
Bitmap may be rotated 90° to the right. (Not supported)
Bitmap may be rotated 90° to the left. (Not supported)
Bitmap may be rotated 180° - upside down. (Not supported)
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
66
RecCartridgeState Property
Type int
Remarks Indicates the status of the currently selected Receipt cartridge (ink, ribbon or toner).
Since the POS printer is the thermal printer, this is fixed to the following value..
Errors
Value Meaning
PTR_CART_UNKNOWN (268435456)
The device does not support the feature of notifying the cartridge state.
This property is initialized and kept current while the device is enabled..
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
RecCurrentCartridge Property R/W
Type int
Remarks
Errors
Selection of the receipt cartridge is not supported. It is initialized to 0.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL(106) Specifying cartridge state is invalid.
RecEmpty Property
Type boolean
Remarks
Errors
true: The receipt is out of paper.
false: The receipt paper is present.
This property is initialized when the device is enabled and updated to the current value while the device is enabled.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
67
RecLetterQuality Property R/W
Type boolean
Remarks
Errors
true: Prints in normal printing mode.
false: Prints in high speed printing mode.
This property is initialized to true when the device is first enabled after the open method.
High quality printing mode affects the built-in characters and down-load characters. And at the same time, in case of double-width and double-height characters, it can print with smoothing processing, but it prints a little bit slower.
In case of normal printing mode, bitmap is printed in 1/3 resolution. (The inputted size is same as that of high quality printing mode but its resolution is 1/3. Also, in case of printing of double-width- and-double-height built-in characters and larger than that, smoothing processing is not done.
When the bitmap is registered by SetBitmap, it is not affected by the RecLetterQuality at that time.
(If the bitmap is registered by SetBitmap, printing the bitmap centered or aligned right in the normal print mode results printing position incorrect. In such case, it is recommended to print in high-quality print mode.)
In case of bitmap printing in Escape Sequence, in high quality printing mode, printing is in normal resolution, and in normal printing mode, printing is in.1/2 resolution. (double-width and double-height) The method follows RecLetterQuality in the same way.
(*When Smoothing setting is off in the jpos.xml settings, it does not do smoothing processing even when it is set to true.)
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
68
RecLineChars Property R/W
Type boolean
Remarks It is the number of the half-size characters, per line of receipts. This property is initialized to one of the following values by the open method according to the setting.
Printing is done in the following font, according to the assigned number of half-size characters per line of receipt.
Characters per Line Printing Font (WidthxHeight)
Printer Setting: Paper width 83 mm (640 dots)
53 (double-width 26)
64 (double-width 32)
12x24 dots (font A)
10x24 dots (font B)
80 (double-width 40) 8x16 dots (font C)
Printer Setting: Paper width 80 mm (576 dots)
48 (double-width 24) 12x24 dots (font A)
57 (double-width 28)
72 (double-width 36)
10x24 dots (font B)
8x16 dots (font C)
Printer Setting: Paper width 80 mm (512 dots)
42 (double-width 21)
51 (double-width 25)
64 (double-width 32)
12x24 dots (font A)
10x24 dots (font B)
8x16 dots (font C)
Printer Setting: Paper width 60 mm (436 dots)
36 (double-width 16) 12x24 dots (font A)
43 (double-width 21)
54 (double-width 27)
10x24 dots (font B)
8x16 dots (font C)
Printer Setting: Paper width 58 mm (420 dots)
35 (double-width 17)
42 (double-width 21)
12x24 dots (font A)
10x24 dots (font B)
52 (double-width 26) 8x16 dots (font C)
Printer Setting: Paper width 58 mm (384 dots)
32 (double-width 16) 12x24 dots (font A)
38 (double-width 19)
48 (double-width 24)
10x24 dots (font B)
8x16 dots (font C)
69
Errors
If this value is changed to supported line character width, the character width is set up to the assigned value. If it cannot support exact width, it is set up to the nearest value in supported line width and at the same time larger value than supported line width. (For example, when to set up paper width to 83 mm and to set 40 for Printer, Device Service will select character size of "53".) If it cannot support character width, Error will return.
Setting RecLineChars may also update the RecLineHeight, RecLineSpacing,
RecSideWayMaxChars and RecSidewaysMaxlinesa properties.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL(106) Illegal line character width is specified.
RecLineCharsList Property
Type String
Remarks Holds the character string including the line character widths supported by the receipt station.
This property is initialized to one of the following values by the open method according to the paper width and the setting..
Errors
Printer Paper Width Value
Paper Width 83mm (640 dots) "53,64,80"
Paper Width 80mm (576 dots) "48,57,72"
Paper Width 80mm (512 dots) "42,51,64"
Paper Width 60mm (436 dots) "36,43,54"
Paper Width 58mm (420 dots) "35,42,52"
Paper Width 58mm (384 dots) "32,38,48"
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
70
RecLineHeight Property R/W
Type int
Remarks Holds the receipt print line height, expressed in the unit of measure given by MapMode.
When RecLineChars is changed, RecLineHeight is updated to the default line height for the selected width.
The value of RecLineHeight is initialized by the open method to the default line height for the POS
Printer. It has one of the following values (the value of the property is when the MapMode property is PTR_MM_DOTS(1)):
Characters per Line Value of the RecLineHeight Property
Printer Setting: Paper width 83 mm (640 dots)
53 24
64 24
80 16
Printer Setting: Paper width 80 mm (576 dots)
48 24
57 24
72 16
Printer Setting: Paper width 80 mm (512 dots)
42 24
51 24
64 16
Printer Setting: Paper width 60 mm (436 dots)
36 24
43 24
54 16
Printer Setting: Paper width 58 mm (420 dots)
35 24
42 24
52 16
Printer Setting: Paper width 58 mm (384 dots)
71
Errors
32 24
38 24
48 16
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106) This property cannot be accessed. It can be only acquired
RecLineSpacing Property R/W
Type int
Remarks
Errors
Holds the spacing of each single-high print line, including both the printed lineheight plus the whitespace between each pair of lines. This property is expressed in the unit of measure given by
MapMod.
If the value of RecLineHeight is larger than the value specified for RecLineSpacing after
RecLineChars is changed, this property is set to the same value as RecLineHeight.
RecLineSpacing is initialized to the default spacing of the POS Printer after the open method.
The available range of the value is from 16 (dot) through 127 (dot).
JposException may be thrown.
ErrorCode for the exception will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106) The range set for the property is invalid.
RecLinesToPaperCut Property
Type int
Remarks
Errors
It holds the number of lines that must be advanced before the receipt paper is cut.
This is the line count before reaching the paper cut mechanism.
Changing the properties RecLineChars, RecLineHeight, and RecLineSpacing may cause this property to change.
JposException may be thrown.
ErrorCode for the exception will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
72
RecLineWidth Property
Type int
Remarks Holds the width of a line of RecLineChars characters. This property is expressed in the unit of measure given by MapMode.
This property is initialized by the open method.
It has one of the following values according to the paper width:
Errors
Paper Width
Paper width 83 mm
Paper width 80 mm
Paper width 80 mm
Paper width 60 mm
Paper width 58 mm
Paper width 58 mm
Value
640
576
512
436
420
384
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
RecNearEnd Property
Type boolean
Remarks
Errors
true: The receipt paper is low.
false: The receipt paper is not low.
This property is initialized when device enabled, and the current value is kept while it enabled.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
73
RecSidewaysMaxChars Property
Type int
Remarks Holds the maximum number of half-width characters that may be printed on each line in sideways mode. It has one of the following values. Since the width of 90 degrees rotating to the left or to the right is declined to half when the CapRec2Color property is true (2 colors), the number of printable characters is half of the value.
2 Colors Characters per Line Characters per Line in Sideways Mode
Printer Setting: Paper width 83 mm (640 dots)
53 (double-width 26)
64 (double-width 32)
138
166
80 (double-width 40) 207
Printer Setting: Paper width 80 mm (576 dots)
48 (double-width 24) 138
57 (double-width 28)
72 (double-width 36)
166
207
Printer Setting: Paper width 80 mm (512 dots)
42 (double-width 21)
51 (double-width 25)
64 (double-width 32)
138
166
207
Printer Setting: Paper width 60 mm (436 dots)
36 (double-width 16) 138
43 (double-width 21)
54 (double-width 27)
166
207
Printer Setting: Paper width 58 mm (420 dots)
35 (double-width 17)
42 (double-width 21)
138
166
52 (double-width 26) 207
Printer Setting: Paper width 58 mm (384 dots)
32 (double-width 16) 138
38 (double-width 19)
48 (double-width 24)
166
207
69
83
103
69
83
103
69
83
103
69
83
103
69
83
103
69
83
103
74
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
75
RecSidewaysMaxlLines Property
Type int
Remarks
Errors
Holds the maximum number of lines that may be printed on each line in sideways mode.
The value of this property is obtained when the value of RecLineWidth is divided by the value of
RecLineSpacing. If the reminder is equal to or greater than the value of RecLineHeight (font height), the value of this property is the sum of the reminder and one (1). Thus, changing
RecLineSpacing may cause this property to change.
If the printing font is font C (refer to the RecLineChars property), then RecLineWidth is 7 (dot) to calculate the value of this property acceding to the conditions above.
This property is initialized when Device is enabled for the first time after Open Method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
76
RotateSpecial Property R/W
Type int
Remarks
Errors
It shows the rotation orientation for bar codes.
This property is initialized to PTR_RP_NORMAL(1) by the open method.
This property has one of the following values:
Value Meaning
PTR_RP_NORMAL (1) Prints subsequent bar codes in normal orientation.
PTR_RP_RIGHT90 (2)
PTR_RP_LEFT90 (3)
Rotate printing 90 degree to the right.
Rotate printing 90 degree to the left.
PTR_RP_ ROTATE180 (259) Rotate printing 180 degree, that is, print upside-down.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106) An invalid parameter value was used.
77
*The following specific POS printer properties are not supported.
boolean CapConcurrentJrnRec; boolean CapConcurrentJrnSlp; boolean CapConcurrentRecSlp; boolean CapConcurrentPageMode; boolean CapJrn2Color; boolean CapJrnBold; int CapJrnCartridgeSensor; int CapJrnColor; boolean CapJrnDhigh; boolean CapJrnDwide; boolean CapJrnDwideDhigh; boolean CapJrnEmptySensor; boolean CapJrnItalic; boolean CapJrnNearEndSensor; boolean CapJrnPresent; boolean CapJrnUnderline; boolean CapSlp2Color; boolean CapSlpBarCode; boolean CapSlpBitmap; boolean CapSlpBold; booleanCapSlpBothSidesPrint; int CapSlpCartridgeSensor; int CapSlpColor; boolean CapSlpPageMode; boolean CapSlpDhigh; boolean CapSlpDwide; boolean CapSlpDwideDhigh; boolean CapSlpEmptySensor; boolean CapSlpFullslip; boolean CapSlpItalic; boolean CapSlpLeft90; boolean CapSlpNearEndSensor; boolean CapSlpPresent; boolean CapSlpRight90; boolean CapSlpRotate180; boolean CapSlpUnderline; int JrnCartridgeState; int JrnCurrentCartridge; boolean JrnEmpty; boolean JrnLetterQuality; int JrnLineChars;
String JrnLineCharsList; int JrnLineHeight; int JrnLineSpacing; int JrnLineWidth; boolean JrnNearEnd;
String SlpBarCodeRotationList;
String SlpBitmapRotationList; int SlpCartridgeState; int SlpCurrentCartridge; boolean SlpEmpty; boolean SlpLetterQuality; int SlpLineChars;
String SlpLineCharsList; int SlpLineHeight; int SlpLinesNearEndToEnd; int SlpLineSpacing; int SlpLineWidth; int SlpMaxLines; boolean SlpNearEnd; int SlpSidewaysMaxChars; int SlpSidewaysMaxLines;
int SlpPrintSide;
78
3.6. Specific Methods beginInsertion Method
Syntax void beginInsertion (int timeout) throws JposException;
Remarks
Errors
Because this method is only applicable for the Slip Printers, this is not supported by this driver.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The POS printer does not have the slip
beginRemoval Method
Syntax void beginRemoval (int timeout) throws JposException;
Remarks Because this method is only applicable for the Slip Printers, this is not supported by this driver.
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The POS printer does not have the slip
79
changePrintSide Method
Syntax void changePrintSide (int side) throws JposExecption;
Remarks Because this method is only applicable for the Slip Printers, this is not supported by this driver.
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The POS printer does not have the slip
clearPrintArea Method
Syntax void clearPrintArea() throws JposException
Remarks
Errors
This method is not supported by this driver.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The POS printer does not have the slip
80
cutPaper Method
Remarks
Errors
Percentage Parameter indicates the percentage of the paper to be cut. When the value is between '1' to '99', partial cutting is performed. When the value is '100', full cutting is performed.
When the value is other than '1' to '100', JPOS_E_ILLEGAL(106) is returned.
This method is called when to cut receipt paper.
This method is executed synchronously if AsyncMode is false and asynchronously if AsyncMode is true. When the printNormal method or printImmediate method is called, paper cutting can be done using Escape Sequence of paper cutting, too. In addition to that, if POS Printer has buffered data (even though printing is requested, POS Printer does not print), it cannot cut paper. In order to cut receipt paper, it must be at the head of each line.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
JPOS_E_NOHARDWARE (107) The POS printer is not connected to the system or is not powered on.
JPOS_E_FAILURE(111) The POS printer is in error state. Execute the method after the error state is cleared.
JPOS_E_TIMEOUT(112)
JPOS_E_BUSY (113)
This operation cannot be performed while the device is disabled.
Illegal percentage is assigned.
Sending data to the POS Printer was timed out, or cpmpletion of printing could not be confirmed after time out.
This operation cannot be performed while output is in progress.
ErrorCodeExtended =
JPOS_EPTR_COVER_OPEN (201):
The POS Printer cover is open.
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_REC_EMPTY (203):
The receipt station is out of paper.
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_FATAL (10003):
A non-recoverable error occurred.
81
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_OVERHEAT (10006):
The print head is overheated.
(Can be returned only if AsyncMode is false.)
endInsertion Method
Syntax void endInsertion () throws JposException;
Remarks
Errors
Because this method is only applicable for the Slip Printers, this is not supported by this driver.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The POS printer does not have the slip
endRemoval Method
Syntax void endRemoval () throws JposException;
Remarks Because this method is only applicable for the Slip Printers, this is not supported by this driver.
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The POS printer does not have the slip
82
markFeed Method
Syntax void markFeed (int type) throws JposException;
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The receipt print station does not support the capability of mark sensed paper handling. (Refer to the CapRecMarkFeed property)
pageModePrint Method
Remarks
Errors
The control parameter has one of the following values:
Value
PTR_PM_PAGE_MODE(1)
PTR_PM_NORMAL(3)
PTR_PM_CANCEL(4)
Description
Starts the page mode.
Prints printing data within the print area in the page mode, deletes printing dara, and then exits the page mode.
Deletes printing data within the print area in the page mode, and exits the page mode without printing.
It is not supported by this driver.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The POS printer does not have the slip
83
printBarCode Method
Syntax void printBarCode (int station, String data,
int symbology, int height, int width, int alignment, int textPosition) throws JposException;
Parameter Description
station PTR_S_RECEIPT(2) is assigned.
data symbology height
The character string of the bar code.
Bar code symbol type to use. (Refer to the following values.) width
Bar code height. Expressed in the unit of measure given by
MapMode. Possible values are 1 to 255 dots.
With PDF417, for normal orientation and upside-down printing, the value can be set to 12 to 831, and for rotated printing 90 degree to the left/right, the value can be set 172 dots to the value of RecLineWidth.
Bar code width. Expressed in the unit of measure given by
MapMode. For normal orientation and upside-down printing, the value can be set to the value set by RecLineWidth. With
PDF417, for normal orientation and upside-down printing, the value can be set to 172 to the value of RecLineWidth, and for rotated printing 90 degree to the left/right, the value can be set
172 to 831 dots. alignment
textPosition
Placement of the bar code. Refer to the values below.
Placement of the readable character string. Refer to the values below.
The symbology parameter in this release has one of the following values:
Value Label Type
PTR_BCS_UPCA(101) UPC-A
PTR_BCS_UPCE(102) UPC-E
PTR_BCS_EAN8(103) EAN 8 (= JAN 8)
PTR_BCS_JAN8(103)
PTR_BCS_EAN13(104)
JAN 8 (= EAN 8)
EAN 13 (= JAN 13)
PTR_BCS_JAN13(104)
PTR_BCS_ITF(106)
JAN 13 (= EAN 13)
Interleaved 2 of 5
PTR_BCS_Codabar(107) Codabar(NW-7)
84
Remarks
The alignment parameter has one of the following values:
Value Meaning
PTR_BC_LEFT (-1) Aligns with the left-most print column. (Since alignment is applied to the print data before the rotation, for upside-down printing, the bar code is aligned right with print direction of the
POS Printer.)
PTR_BC_CENTER (-2)
PTR_BC_RIGHT (-3)
Other Values
Aligns in the center of the station.
With PDF 417, this parameter is not supported during rotated printing 90 degree to the left/right. It operates as
PTR_BC_LEFT (1).
Aligns with the right-most print column. (Since alignment is applied to the print data before the rotation, for upside-down printing, the bar code is aligned left with print direction of the
POS Printer.)
With PDF 417, this parameter is not supported during rotated printing 90 degree to the left/right. It operates as
PTR_BC_LEFT (1).
Distance from the left-most print column to the start of the bar code. Expressed in the unit of measure given by MapMode. If the sum of the actual width of bar code that is calculated from the specified bar code width by the width parameter and the distance from the left-most print column exceeds the value of
RecLineWidth, then the application returns JPOS_E_ILLEGAL
(106). In this case, if RotateSpecial is PTR_RP_RIGHT90
(257) or PTR_RP_LEFT90 (258), the application regards that this parameter is set to PTR_BC_LEFT (-1) and performs printing.
With PDF 417, this parameter is not supported during rotated printing 90 degree to the left/right. It operates as
PTR_BC_LEFT (1).
The textPosition parameter has one of the following values:
Value Meaning
PTR_BC_TEXT_NONE (-11) No text is printed. Only prints the bar code.
PTR_BC_TEXT_ABOVE (-12) Prints the text above the bar code.
PTR_BC_TEXT_BELOW (-13) Prints the text below the bar code.
This method is called when to print bar codes with the assigned POS Printer.
This method is executed synchronously if AsyncMode is false, and asynchronously if AsyncMode is true.
85
symbology
Following are printable bar code conditions per each symbology. On rotation printing, the range of available values differs depending on whether 2 colors printing (CapRec2Color = TRUE) is available.
Each printable character kind
10 kinds ('0'-'9')
Upright/Upside-down mode
Character string length
Width (dots)
RecLineWidth
Value
RecLineWidth
Value
90 degree rotation to the left/right
Character string length
Width
(dots)
Width
(dots)
2Colors
11-12 95- 95-
1662 831
11-12 51- 51-
1662 831
PTR_BCS_JAN13 12-13
RecLineWidth
Value
95-
RecLineWidth
Value
PTR_BCS_CODE39 43 kinds ('0'-'9',
'A'-'Z', space, '$', '%',
'+', '-', '.', '/')
1-34
(Start/Stop character of '*' is automatically added.)
PTR_BCS_ITF 10 kinds ('0'-'9') 2-62
47-
RecLineWidth
Value
PTR_BCS_CODABE
R
20 kinds ('0'-'9',
'A'-'D', '$', '+', '-', '.', '/',
':')
3-47
27-
RecLineWidth
Value
41-
RecLineWidth
Value
PTR_BCS_CODE93 46-
(0x00-0x7F)
1-29
RecLineWidth
Value
(Lower stage is for two characters)
12-13 95- 95-
1662 831
1-101 47- 47-
1662 831
2-182 27- 27-
1662 831
3-138 41- 41-
1662 831
1-44
1662
46-
1662
831
46-
831
86
PTR_BCS_CODE128 Code Set A:
0x00 - 0x5F
Code Set B
0x20 - 0x7F
3-51
Code Set C
0x00 - 0x63
However the characters including
"{" are exception. For details refer to later.
PTR_BCS_PDF417 256 kinds including
00x00 to 0xFF. The character strings 0x00 to 0x7F conform to the ASCII code, and
0x80 to 0xFF conform to the extended character sets in the
1-1069
English table of
PC437 (USA:
Standard Europe)
46-
RecLineWidth
Value
172-
RecLineWidth
Value
1662
1-1069 172-
831
831
172-
831
Following is printing width decision algorithm for each bar code. As for final printing width (dot), printing is done with nearest value not exceeding the value assigned by Width Parameter of
PrintBarcode, in changing parameters. symbology Formula for calculating printing width
PTR_BCS_UPCA
PTR_BCS_UPCE
PTR_BCS_JAN8
PTR_BCS_JAN13
PTR_BCS_CODE39
Bar code width = 95 * dotNarrow
Bar code width = 51 * dotNarrow
Bar code width = 67 * dotNarrow
Bar code width = 95 * dotNarrow
Bar code width =
6 * dotNarrow + 3 * dotWide + 1 * dotNarrow +
(6 * dotNarrow + 3 * dotWide + 1 dotNarrow)* Length +
6 * dotNarrow + 3 * dotWide
(Length = Number of characters printed)
87
PTR_BCS_ITF
PTR_BCS_CODABER
PTR_BCS_CODE93
PTR_BCS_CODE128
PTR_BCS_PDF417
Bar code width =
4 * dotNarrow +
(3 * dotNarrow + 2 * dotWide) * Length +
2 * dotNarrow + 1 * dotWide
(Length = Number of characters printed)
Bar code width =
(5 * dotNarrow + 2 * dotWide) * (Length – Wlen) +
(4 * dotNarrow + 3 * dotWide) * Wlen +
1 * dotNarrow * (Length + 1)
(Length = Number of characters printed)
(Wlen = Number of characters among ":", "/", ".", "+", "A", "B", "C",
"D")
Bar code width =
9 * dotNarrow +
9 * dotNarrow * Wlen + (9 * dotNarrow) * 2 * (Length - Wlen) +
9 * 2 * dotNarrow +
10 * dotNarrow
(Length = Number of characters printed)
(Wlen =Number of characters among "0"-"9", "A"-"Z", " ", "$", "%",
"+", "-", "/")
Bar code width =
11 * dotNarrow * (Length + 1) +
13 * dotNarrow
(Length = Number of characters printed – Special characters*1)
*1: Number of characters which head is "{". If "{AA{BA" is assigned,
Length = 6 – 2 = 4.
Bar code width = ((17 * (C + 2)) + (17 + 18)) * X
Bar code height = RYX
C: Number of columns
X: Nominal width of narrow element
R: Number of rows
Y: Row height
* For number of rows and number of columns, the minimum value that input data can convert as the bar code is selected. For nominal width of narrow element and row height, after number of rows and number of columns are determined, maximum size that does not exceed the Width and Height parameters is selected.
88
*Relation between dotNarrow and dotWide dotNarrow 1 2 3 4 dotWide 3 5 9 11
5
14
6
18
Notes for Bar Code Printing
1. When to print CODE39, "*" (Start/Stop Character) is automatically added. So, there is no deed of setting up in Character.
2. When to assign ITF, even-number character must be assigned. If odd-number is assigned,
JPOS_E_ILLEGAL(106) will return.
3. When to assign CODABER, the head and the tail of the characters must be among "A" - "D".
Accordingly, three or more than three characters (the head character plus any characters plus the tail character) must be assigned. In the other cases, JPOS_E_ILLEGAL(106) returns.
4. When to assign UPC-E, development is done according to the following list. UPC-A Left
Code shows top characters (2-6), UPC-A Right Code shows 7th-11th characters. The shortened code is actually printed as UPC-E. If the UPC-A top character assigned is except 0 or, characters not based on the following list is assigned, JPOS_E_ILLEGAL(106) returns
Example 05810000226 -> Converted to c58226.
09859363583 -> JPOS_E_ILLEGAL returns.
Manufacturer Code
Left Code for UPC-A
Item Code
Right Code for UPC-A
Shortened Code
F1 F2 F3 F4 F5 A1 A2 A3 A4 A5 Z1 Z2 Z3 Z4 Z5 Z6
0-9 0-9 0 0 0 0 0 0-9 0-9 0-9 F1 F2 A4 0
0-9 0-9 1 0 0 0 0 0-9 0-9 0-9 F1 F2 A4 1
0-9 0-9 2 0 0 0 0 0-9 0-9 0-9 F1 F2 A4 2
0-9 0-9 3-9 0 0 0 0 0 0-9 0-9 F1 F2 F3 A4 A5 3
0-9 0-9 0-9 1-9 0 0 0 0 0 0-9 F1 F2 F3 F4 A5 4
0-9 0-9 0-9 0-9 1-9 0 0 0 0 5-9 F1 F2 F3 F4 F5 A5
89
5. When to print CODE128, set up characters as followed.
1. One of "{A", "{B", "{C" must be assigned as the head of the bar code. Following that, each of CODE A, CODE B, CODE C must be set up.
2. When to assign Function Code, assign "{1", "{2", "{3", or "{4". Each is to assign FNC1,
FNC2, FNC3, or FNC4. For further information, in CODE C, only FUNC1is available. If you assign except FUNC1 in CODE C, JPOS_E_ILLEGAL(106) returns.
3. When to print "{" in CODE B, assign "{{".
4. When to set up SHIFT, assign "{S". After that, code set of one character sifts like CODE
A <- -> CODE B. If you assign in CODE C, JPOS_E_ILLEGAL(106) returns.
Following are printable character in CODE A, CODE B, CODE C.
[Code128]
Character to Print
CODE-B
Character to Print
CODE-B CODE-A CODE-C CODE-A
SPACE SPACE 00(00H) U U
CODE-C
53(35H)
" " 02(02H) W W 55(37H)
90
CODE-A
Character to Print
CODE-B CODE-C CODE-A
Character to Print
CODE-B CODE-C
VT(0BH) k 75(4BH)
DC1(11H) q 81(51H)
F F
38(26H)
ESC(1BH) {
91(5BH)
"{{"
P P
48(30H)
Q Q 49(31H)
91
FNC 3
"{3"
FNC 2
FNC 3
"{3"
FNC 2
96(60H)
97(61H)
98(62H)
99(63H)
CODE-A
Character to Print
CODE-B CODE-C
R R
50(32H)
S S
51(33H)
T T
52(34H)
Character to Print
CODE-A CODE-B CODE-C
"{2" "{2"
SHIFT
"{S"
CODE C
"{C"
SHIFT
"{S"
CODE C
"{C"
CODE B
"{B"
FNC 4
"{4"
FNC 1
"{1"
CODE A
"{A"
FNC 4
"{4"
FNC 1
"{1"
CODE B
"{B"
CODE A
"{A"
FNC 1
"{1"
92
6. Following are TextPosition assignment, and bar code printing possibility condition according to Width. As for Width Parameter, if without special description, they mean that it is possible to print bar codes independently on TextPosition, within the printable area. As for the following list, it is prerequisite that Width Parameter is in units of dots and that it is within the printable area symbology
PTR_BCS_UPCA(101)
PTR_BCS_UPCE(102)
PTR_BCS_JAN8(103) textPosition
PTR_BC_TEXT_NONE
Printable
Printable
Printable extPosition
PTR_BC_TEXT_ABOVE
PTR_BC_TEXT_BELOW
Width=95 - 189
JPOS_E_ILLEGAL
Width=51 - 101
JPOS_E_ILLEGAL
Width=67 - 133
JPOS_E_ILLEGAL
PTR_BCS_JAN13(104) Printable
PTR_BCS_CODE39(108) Printable
PTR_BCS_ITF(106) Printable
PTR_BCS_Codabar(107) Printable
Width=95 - 189
JPOS_E_ILLEGAL
Printable
Printable
Printable
PTR_BCS_CODE93(109)
PTR_BCS_CODE128(110)
* 1
* 2
* 1
* 2
PTR_BCS_PDF417(201) Printable
(The character string is not output.)
Printable
(The character string is not output.)
*1: If width and number of characters are within the range as follows, JPOS_E_ILLEGAL will be returned:
37 + 9 * wlen + 18(len - wlen) <= width < 74 + 18 * wlen + 36(len - wlen)
- wlen = the number of '0' - '9', 'A' - 'Z', ' ', '$', '%', '+', '-', '.', '/' within character
- len = Character length
*2: If width and number of characters are within the range as follows, JPOS_E_ILLEGAL will be returned.
24 + 11 * len <= width < 48 + 22 * len
- len = The gained value by subtracting the number of "{A", "{B", "{C", "{1", "{2", "{3", "{4",
"{S", "{{" (which are included in the character length) from the character length.
93
Rotating Bar Code Printing by the RotateSpecial property
Printing positions are changed as follows by the alignment parameters in normal orientation.
Align Right
Centering
Bar code
Aligned
Align Left
Printing Direction
Distance from the left most print column set by alignment
Printing positions are changed as follows by the alignment parameters in upside-down orientation.
Align Left
Bar code
(Upside-down)
Centering
Align Right
Printing direction
Aligned
Distance from the left most print column set by alignment
94
Printing positions are changed as follows by the alignment parameters in 90-degree-to-the-right orientation.
Align left
Bar code
Centering
Top of bar code
Printing Direction
Align right
Printing positions are changed as follows by the alignment parameters in 90-degree-to-the-left orientation.
Align left Bar code
Centering
Align right
Top of bar code
Printing direction
95
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
One of the following conditions has occurred:
- station does not exist.
- station does not support bar code printing.
- height or width are zero or too big.
- symbology is not supported.
- symbology contains unsupported character.
- alignment is invalid or too big (If alignment is specified to an absolute position, the sum of the value of alignment and the actual printing width of bar code - the value calculated by the closest value of width - exceeds the available width.)
JPOS_E_FAILURE(111)
- textPosition is invalid .
JPOS_E_NOHARDWARE (107) The POS printer is not connected to the system or is not powered on..
The POS printer is in error state. Execute the method after the error state is cleared.
JPOS_E_TIMEOUT(112)
JPOS_E_BUSY (113)
Sending data to the POS Printer was timed out, or cpmpletion of printing could not be confirmed after time out.
This operation cannot be performed because processing is in progress.
ErrorCodeExtended =
JPOS_EPTR_COVER_OPEN (201):
The POS Printer cover is open.
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_REC_EMPTY (203):
The receipt station is out of paper.
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_FATAL (10003):
A non-recoverable error occurred.
96
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_OVERHEAT (10006):
The print head is overheated.
(Can be returned only if AsyncMode is false.)
97
printBitmap Method
Syntax void printBitmap (int station, String fileName,
int width, int alignment) throws JposException;
Parameter Description
station PTR_S_RECEIPT(2) is assigned.
fileName File name of bitmap file The file must in the compressed .format.
(Specify full path or relative path.)
width
alignment
Printed width of the bitmap to be performed. See values below.
Placement of the bitmap. See values below.
The width parameter has one of the following values:
Value Meaning
PTR_BM_ASIS (-11) Prints the bitmap with one bitmap pixel per printer dot.
Other Values Bitmap width expressed in the unit of measure given by
MapMode. Valid values are 1 to the value of the
RecLineWidth property.
Remarks
The alignment parameter has one of the following values:
Value Meaning
PTR_BM_LEFT (-1) Align with the left-most print column.
PTR_BM_CENTER (-2)
PTR_BM_RIGHT (-3)
Other Values
Align in the center of the station.
Align with the right-most print column.
Distance from the left-most print column to the start of the bitmap. Expressed in the unit of measure given by MapMode.
The sum of this value and width should not exceed the limitation of the width parameter.
This method is called to print a bitmap on the specified printer. The bitmap is converted to monochrome or 2 colors and printed.
When 2-color printing is set, black is printed as the first color and red is printed as the second color.
The size of the bitmap that can be registered is the horizontal size (Width) that is the dots of
RecLineWidth or less (when Alignment is absolute position specified, Width + Alignment <=
RecLineWidth) and the vertical size that is 1662 dot for single color data and 831 dot or less for two color data with 2 color setting.
Because PrintBitmap sends bitmap data to the printer at the time of being called, the performance is not high. It is recommended to print the bitmap with SetBitmap and the Escape Sequence.
This method is synchronously executed if AsyncMode is false, and asynchronously if AsyncMode is true.
The width parameter controls transformation of the bitmap. If width is PTR_BM_ASIS, then no
98
Errors transformation is performed. The bitmap is printed with one bitmap pixel per one POS Printer dot.
If width is not 0, then the bitmap will be transformed by stretching or compressing the bitmap such that its width is the specified width and the aspect ratio is unchanged.
* When the specified bitmap data is in monochrome, monochrome bitmap is set in the printer. For data other than in monochrome, when the CapRec2Color property is true, 2-color bitmap printing is performed. When the property is false, it is printed as monochrome data.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
One of the following conditions has occurred:
- station does not exist.
- station does not support bitmap printing.
JPOS_E_NOHARDWARE (107) The POS printer is not connected to the system or is not powered on.
JPOS_E_NOEXIST (109)
JPOS_E_FAILURE(111)
The file specified by fileName was not found.
The POS printer is in error state. Execute the method after the error state is cleared.
JPOS_E_TIMEOUT(112)
- width is too big.
- alignment is invalid or too big.
JPOS_E_BUSY (113)
Sending data to the POS Printer was timed out, or cpmpletion of printing could not be confirmed after time out.
This operation cannot be performed while output is in progress.
(Returned only when AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_COVER_OPEN (201):
The POS Printer cover is open.
(Returned only when AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_REC_EMPTY (203):
The receipt station is out of paper.
(Returned only when AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_TOOBIG (206):
99
The bitmap width is too big.
Printable bitmap size is: Width (number of dot of
RecLineWidth Property) Height (monochrome: 1662 dot,
2-clor setting: 831 dot).
ErrorCodeExtended =
JPOS_EPTR_BADFORMAT (207):
This is returned when the specified file is not the bitmap file.
This error is delivered when data is 24 bit bitmap in 2 colors setting as well.
(For monochrome printing, 24 bit bitmap can be printed.)
ErrorCodeExtended = JPOS_FIT_EPTR_FATAL (10003):
A non-recoverable error occurred.
(Returned only when AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_OVERHEAT (10006):
The print head is overheated.
(Returned only when AsyncMode is false.)
100
printImmediate Method
Syntax void printImmediate (int station, String data) throws JposException;
Remarks
Errors
Parameter Description
station PTR_S_RECEIPT(2) is assigned.
data The characters to be printed. May consist of printable characters, escape sequences, carriage returns (13 decimal), and newline / line feed (10 decimal).
This method is called to print data to the POS Printer During asynchronous printing
(State=JPOS_S_BUSY(3)), JPOS_E_BUSY(113) is returned. During the error event
(State=JPOS_S_ERROR(4)), JPOS_E_FAILURE(111) is returned. It performs a reverse line feed in the case that characters per line of the text exceed maximum-characters-per-line.
Special character values within data are:
Value Meaning
Newline / Line Feed (10 decimal)
Print any data in the line buffer, and feed to the next print line.
(A Carriage Return is not required in order to cause the line to be printed.).
Carriage Return (13 decimal) If a Carriage Return immediately precedes a Line Feed, or if the line buffer is empty, then it is ignored.
Carriage Return acts like a Line Feed.
The validateData method may be used to determine whether a
Carriage Return without Line Feed is possible, and whether a reverse line feed is required to support it.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The POS Printer specified (other than the receipt station) does not exist.
JPOS_E_FAILURE(111)
JPOS_E_TIMEOUT(112)
JPOS_E_BUSY (113)
The POS printer is in error state. Execute the method after the error state is cleared.
Sending data to the POS Printer was timed out, or cpmpletion of printing could not be confirmed after time out.
This operation cannot be performed while output is in progress.
101
ErrorCodeExtended =
JPOS_EPTR_COVER_OPEN (201):
The POS Printer cover is open.
ErrorCodeExtended =
JPOS_EPTR_REC_EMPTY (203):
The receipt station is out of paper.
ErrorCodeExtended =
JPOS_FIT_EPTR_FATAL (10003):
A non-recoverable error occurred.
ErrorCodeExtended =
JPOS_FIT_EPTR_OVERHEAT (10006):
The print head is overheated.
102
printMemoryBitmap Method
JposException;
Parameter Description
Station It assigns PTR_S_RECEIPT(2)
Data
Type
Pointer to the byte array that holds the bitmap data.
PTR_BMT_BMP is specified.
Width
Alignment
Printed width of the bitmap to be performed. See values below.
Placement of the bitmap. See values below.
The Width parameter has one of the following values:
Value Meaning
PTR_BM_ASIS(-11) Prints the bitmap with one bitmap pixel per POS Printer dot.
Other Values Bitmap width. Expressed in the unit of measure given by
MapMode.
The Alignment parameter has one of the following values:
Value Meaning
PTR_BM_CENTER(-2) Centering
Remarks
The others Distance from the left-most print column to the start of the bitmap. Expressed in the unit of measure given by MapMode.
This method is called to print a memory-stored bitmap on the specified printer station.. The bitmap passed as the pointer to the byte array is converted to monochrome or 2 colors and printed.
When 2 color printing is set, black is printed as the first color and red is as the second color.
The size of the bitmap that can be registered is the horizontal size (Width) that is the dots of
RecLineWidth or less (when Alignment is absolute position specified, Width + Alignment <=
RecLineWidth) and the vertical size that is 1662 dot for single color data and 831 dot or less for two color data with 2 color setting.
·
·
This method is performed synchronously if AsyncMode is FALSE, and asynchronously if
AsyncMode is TRUE.
The Width parameter controls transformation of the bitmap. If width is PTR_BM_ASIS, then no transformation is performed. The bitmap is printed with one bitmap pixel per POS printer dot.
Advantages of this option are that it:
Provides the highest performance bitmap printing.
Works well for bitmaps tuned for a specific printer’s aspect ratio between horizontal dots and
103
vertical dots.
If Width is not 0, then the will be transformed by stretching or compressing the bitmap such that its width is the specified width and the aspect ratio is unchanged.
Because it is not buffered to TransactionPrint, data can be sent to the printer in the middle of buffering.
Return Value One of the following values is returned and placed in the ResultCode property:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL(106)
This operation cannot be performed while the device is disabled.
One of the following errors occurred.
- No Station.
- Station does not support bitmap printing.
- Width is too large.
- Alignment is illegal value or too large.
JPOS_E_NOHARDWARE(107) POS Printer is OFF or OFFLINE.
JPOS_E_FAILURE(111) The POS printer is in error state. Execute the method after the error state is cleared.
JPOS_E_TIMEOUT(112) Sending data to the POS Printer was timed out, or cpmpletion of printing could not be confirmed after time out.
JPOS_E_BUSY(113) It cannot perform because it outputting.
JPOS_E_EXTENDED(114) ResultCodeExtended =
JPOS_EPTR_COVER_OPEN(201): POS Printer cover is open. (Only when AsyncMode is FALSE, it is returned.)
ResultCodeExtended = JPOS_EPTR_REC_EMPTY(203):
It runs out of paper. (Only when AsyncMode is FALSE, it is returned.)
ResultCodeExtended = JPOS_EPTR_TOOBIG (206):
Assigned bitmap is too large. Printable bitmap size is:
Width (number of dot of RecLineWidth Property) Height
(monochrome: 1662 dot, 2-clor setting: 831 dot)
ResultCodeExtended =
JPOS_EPTR_BADSYNTAX(207):
Bitmap format is different from the assigned one. The assigned file is not bitmap file.
When 2-color printing is set and data is the 24 bit bitmap.
(When monochrome is specified, printing 24 bit bitmap is available.)
104
ResultCodeExtended = JPOS_FIT_EPTR_FATAL(10003):
Fatal error occurs. (Only when AsyncMode is FALSE, it is returned.)
ResultCodeExtended = JPOS_FIT_EPTR_OVERHEAT
(10006):
Head overheat occurs. (Only when AsyncMode is FALSE, it is returned.)
105
printNormal Method
Syntax void printNormal (int station, String data) throws JposException;
Remarks
Errors
Parameter Description
station PTR_S_RECEIPT(2) is assigned. data The characters to be printed. May consist of printable characters, escape sequences, carriage returns (13 decimal), and Newline / line feed (10 decimal).
This method is called to print data on the receipt printer station. It performs a reverse line feed in the case that characters per line of the text exceed maximum-characters-per-line
This method is performed synchronously if AsyncMode is false, and asynchronously if
AsyncMode is true.
Special character values within data are:
Value Meaning
Newline / Line Feed (10 decimal)
Print any data in the line buffer, and feed to the next print line.
(A Carriage Return is not required in order to cause the line to be printed.).
Carriage Return (13 decimal) If a Carriage Return immediately precedes a Line Feed, or if the line buffer is empty, then it is ignored.
Carriage Return acts like a Line Feed.
The validateData method may be used to determine whether a
Carriage Return without Line Feed is possible, and whether a reverse line feed is required to support it.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL(106)
This operation cannot be performed while the device is disabled.
The POS Printer specified (other than the receipt station) does not exist.
JPOS_E_FAILURE(111)
JPOS_E_TIMEOUT(112)
JPOS_E_BUSY (113)
The POS printer is in error state. Execute the method after the error state is cleared.
Sending data to the POS Printer was timed out, or cpmpletion of printing could not be confirmed after time out.
This operation cannot be performed while output is in progress.
106
ErrorCodeExtended =
JPOS_EPTR_COVER_OPEN (201):
The POS Printer cover is open.
(Returned only when AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_REC_EMPTY (203):
The receipt station is out of paper.
(Returned only when AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_FATAL (10003):
A non-recoverable error occurred.
(Returned only when AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_OVERHEAT (10006):
The print head is overheated.
(Returned only when AsyncMode is false.)
107
printTwoNormal Method
Syntax void printTwoNormal (int stations, String data1, String data2) throws JposException;
Remarks
Errors
Parameter Description
station POS Printer station to be used.
data1
data2
Characters to be printed on the first station.
Characters to be printed on the second station.
This method is called to print two strings on two print stations simultaneously.
Because this method is only applicable for the Slip Printers, this is not supported by this driver.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The POS printer specified (other tha the receipt station) does not exist.
108
rotatePrint Method
Syntax void rotatePrint (int station, int rotation) throws JposException;
Remarks
Parameter Description
station PTR_S_RECEIPT(2) is assigned.
rotation Direction of rotation. See values below.
Value Meaning
PTR_RP_RIGHT90 (257) Rotate printing 90 degree to the right (clockwise).
PTR_RP_LEFT90 (258) Rotate printing 90 degree to the left (counterclockwise).
PTR_RP_ROTATE180 (259) Rotate printing 180 degree, that is, print upside-down.
PTR_RP_NORMAL (1) End rotated printing.
This method is executed synchronously if AsyncMode is false, and asynchronously if AsyncMode is true.
If rotation is PTR_RP_ROTATE180, then upside-down print mode is entered. Subsequent calls to
printNormal or printImmediate will print the data upsidedown until rotatePrint is called with the rotation parameter set to PTR_RP_NORMAL. Lines are printed in the order that they are sent to the
POS Printer driver, with the start of each line justified at the right margin of the printer station. Only print methods printNormal, and printImmediate may be used while in upside-down print mode.
If rotation is PTR_RP_RIGHT90 or PTR_RP_LEFT90, then sideways print mode is entered.
Subsequent calls to printNormal will buffer the print data until rotatePrint is called with the
rotation parameter set to PTR_RP_NORMAL. (In this case, the method only buffers the data – it does not initiate printing. Also, the value of the AsyncMode property does not affect its operation:
No OutputID will be assigned to the request, nor will an OutputCompleteEvent be enqueued. For example, even when the POS printer is not powered on, call to any methods will not return an error while rotatePrint is buffering the print data.)
During sideways print mode, the horizontal size will be specified automatically within the range from 0 to 1662 dots for monochrome and from 0 to 831 dots for 2-Color according to the character data that call to the printNormal method buffers. The JavaPOS driver will analyze the character data being buffered, then determine horizontal size according to the maximum value of the width among the lines (see the table below). If the width of total character data exceeds 1662 dots (831 dots for 2-color), horizontal size is set to 1662 dots (831 dots for 2-color). Excess data is wrapped into inside the page and printed. If the horizontal size of the character data is double wide or more according to Escape Sequence, the horizontal size will be determined using the value multiplied by the ratio. (For example, if a Font A ANK character is specified in double-wide, it is regarded as 24 dots.)
If no data has been buffered (printMethod is not called yet), nothing is printed.
Horizontal size of per character (dots)
109
Errors
Font
(Refer to the RecLineChars property)
Font A
Font B
Font C
ANK
12 dot
10 dot
8 dot kanji
24 dot
20 dot
16 dot
When PrintBitmap and PrintMemoryBitmap are issued in upside-down printing mode, bitmap is printed upside-down.
For the bitmap performed SetBitmap in upside-down printing mode, it is registered without upside-down.
If rotation is PTR_RP_NORMAL, then rotated print mode is terminated. If sideways rotated print mode was in effect and some data was buffered by calls to the printNormal method, then the buffered data is printed. The entire rotated block of lines is treated as one message.
Calling the clearOutput method cancels rotated print mode. Any buffered sideways rotated print lines are also cleared.
When the vertical length is specified by Escape Sequence with "n" times and print rotated, print may be overlapped or exceed the paper. In this case, input "LF" code before Escape Sequence to specify vertical length. (Ex. To print the data 3 times length vertically, input "LF" code twice. To print the data "n" times length vertically, input "LF" code with the number of "n-1" times.)
However, if bitmap printing or bar code printing is specified by the Escape Sequence while rotated
90 degree left/right is selected, the vertical width will not be calculated. Then the bitmap or bar code exceeding the vertical width cannot be printed normally since they are calculated by other character data.
In addition, if the bar code is printed using the Escape Sequence ESC|#R, the bar code exceeding the print area cannot be printed. In this case, the position to start the print data need to be adjusted to match the bar code by LF and other measures since such positions in the Page Mode may be different between the one-dimensional bar code and two-dimensional bar code.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
110
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL(106)
This operation cannot be performed while the device is disabled.
The POS Printer specified (other than the receipt station) does not exist.
Or station does not support the specified rotation.
In different rotation mode, assign PTR_RP_NORMAL(1) or re-execute after clearing rotation printing with clearOutput.
JPOS_E_NOHARDWARE (107) The POS printer is not connected to the system or is not powered on..
JPOS_E_FAILURE(111) The POS printer is in error state. Execute the method after the error state is cleared.
JPOS_E_TIMEOUT(112)
JPOS_E_BUSY (113)
Sending data to the POS Printer was timed out, or cpmpletion of printing could not be confirmed after time out.
This operation cannot be performed while output is in progress.
(Returned only when AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_COVER_OPEN (201):
The POS Printer cover is open.
(Returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_REC_EMPTY (203):
The receipt station is out of paper.
(Returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_FATAL (10003):
A non-recoverable error occurred.
(Returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_OVERHEAT (10006):
The print head is overheated.
(Returned only if AsyncMode is false.)
111
setBitmap Method
Syntax
Remarks
Errors
void setBitmap (int bitmapstationNumber, int station, String filename,
int width, int alignment) throws JposException;
Parameter Description
bitmapNumber The number to be assigned to this bitmap. The values from 1 to
20 are valid.
station
fileName
PTR_S_RECEIPT(2) is assigned.
File name of bitmap file The file must in the compressed .format.
(Specify full path or relative path.)
If empty string is set, the bitmap assigned with the specified
bitmapNumber will be deleted from the POS Printer.
width
alignment
Printed width of the bitmap to be performed. For the value, refer to PrintBitmap.
Placement of the bitmap. For the value, refer to PrintBitmap.
It is called when to save the information concerning bitmap soon to be printed.
Bitmap is printed by calling PrintNormal or PrintImmediate which has bitmap printing Escape
Sequence inside printing data.
When 2-color printing is set, black is stored as the first color and red is stored as the second color
The bitmap that can be registered must be RecLineWidth dot (Width) or less (if Alignment is set to absolute position, it is Width+ Alignment<= RecLineWidth), and must be vertical size of 2304dot or less and the data size is 384 KB or less after dithering (after converting the data into interpretable bitmap data for POS Printer). When these conditions are not met, OPOS_EPTR_TOOBIG(206) is issued. In addition, when there is no free space on the nonvolatile memory, OPOS_EPTR_TOOBIG is issued. In such case, set empty space in the FileName parameter to secure free space by deleting the bitmap data from the POS printer, then execute again.
* In this driver, when SetBitmap is executed, the bitmap that is set is effective even after executing
Release Device by driver, because the bitmap is written on nonvolatile memory in the POS Printer.
In other words, once setting is complete, bitmap printing is effective with Escape Sequence.
* When the specified bitmap data is in monochrome, monochrome bitmap is set in the printer. For data other than in monochrome, when the CapRec2Color property is TRUE, 2-color bitmap printing is performed. When the property is FALSE, it is printed as monochrome data.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
112
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
JPOS_E_NOEXIST (109)
JPOS_E_FAILURE (111)
JPOS_E_TIMEOUT(112)
JPOS_E_BUSY (113)
This operation cannot be performed while the device is disabled.
An invalid parameter value was used:
- bitmapNumber is invalid.
- The POS Printer (other than the receipt station) does not exist
- station does not support bitmap printing.
- width is too big.
- alignment is invalid or too big.
fileName was not found.
Sending the bitmap data to the POS printer failed. The printer cover is open, the receipt station is out of paper, or the printer is powered off.
Sending data to the POS Printer was timed out, or cpmpletion of printing could not be confirmed after time out.
This operation cannot be performed while output is in progress.
ErrorCodeExtended =
JPOS_EPTR_TOOBIG (206):
The bitmap width is too big to print without convertion, or is too big to convert.
ErrorCodeExtended =
JPOS_EPTR_BADFORMAT (207):
The specified file is not the bitmap file, or in the format not supported.
For 2-Color print, if the data is 24 bit bitmap, this error is delivered as well.
(For monochrome print, 24 bit bitmap can be printed.).
113
setLogo Method
Syntax void setLogo (int location, String data) throws JposException;
Remarks
Errors
Parameter Description
location The logo to be set. Set PTR_L_TOP (1) for the top logo, and
PTR_L_BOTTOM (2) for the bottom logo. data The characters that produce the logo. May consist of printable characters, escape sequences (except logos), carriage returns (13 decimal), and line feeds (10 decimal).
It is called to save a data string as the top or bottom logo.
A logo may then be printed by calling the printNormal or printImmediate method with the print top logo or print bottom logo escape sequence in the print data.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105) This operation cannot be performed while the device is disabled.
JPOS_E_BUSY (113) This operation cannot be performed while output is in progress.
114
transactionPrint Method
Syntax void transactionPrint (int station, int control) throws JposException;
Remarks
Errors
Parameter Description
station PTR_S_RECEIPT(2) is assigned. control Batch processing. Refer to the following values:
Value Meaning
PTR_TP_TRANSACTION (11) Start of batch processing.
PTR_TP_NORMAL (12) Ends a transaction by printing the buffered data.
This method is called when to enter/leave batch processing.
If control is PTR_TP_TRANSACTION (11), then transaction mode is entered. Subsequent calls to
printNormal, cutPaper, rotatePrint, printBarCode, printBitmap, and directIO will buffer the print data (either at the printer or the Device Service, depending on the printer capabilities) until
transactionPrint is called with the control parameter set to PTR_TP_NORMAL (12). (In this case, the print methods only validate the method parameters and buffer the data – they do not initiate printing. Also, the value of the AsyncMode property does not affect their operation: No OutputID will be assigned to the request, nor will an OutputCompleteEvent be enqueued. In this case, each method is completed successfully. For example, if the POS printer is not powered on, call to each method will not return an error while transactionPrint is buffering the print data.)
If control is PTR_TP_NORMAL (12), then transaction mode is exited. If some data was buffered by calls to the methods printNormal, cutPaper, rotatePrint, printBarCode, printBitmap, and
directIO then the buffered data is printed. The entire transaction is treated as one message. This method is performed synchronously if AsyncMode is false, and asynchronously if AsyncMode is
true.
Calling the clearOutput method cancels transaction mode. Any buffered print lines are also cleared.
Attention should be paid when executing the rotatePrint method. Once the transactionPrint method is executed, the data buffered by calls to the rotatePrint method with PTR_RP_RIGHT90
(257), the printNormal method and the rotatePrint method with PTR_RP_NORMAL (1) will not be printed until transaction mode is exited. If the rotatePrint method is called with
PTR_RP_RIGHT90 (257) and the transactionPrint method is called with
PTR_TP_TRANSACTION (11), the buffered data will not be rotated and cannot be printed correctly because buffering by the transactionPrint method has priority over the rotatePrint method. The rotatePrint method must be executed after the transactionPrint method and transaction mode is exited.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be
115
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106) used.
This operation cannot be performed while the device is disabled.
The POS Printer specified (other than the receipt station) does not exist.
JPOS_E_NOHARDWARE (107) The POS printer is not connected to the system or is not powered on.
JPOS_E_FAILURE(111) The POS printer is in error state. Execute the method after the error state is cleared.
JPOS_E_TIMEOUT(112)
JPOS_E_BUSY (113)
Sending data to the POS Printer was timed out, or cpmpletion of printing could not be confirmed after time out.
This operation cannot be performed while output is in progress.
(Returned only if AsyncMode is false and the control parameter is PTR_TP_NORMAL (12).)
ErrorCodeExtended =
JPOS_EPTR_COVER_OPEN (201):
The POS Printer cover is open.
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_EPTR_REC_EMPTY (203):
The receipt station is out of paper.
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_FATAL (10003):
A non-recoverable error occurred.
(Can be returned only if AsyncMode is false.)
ErrorCodeExtended =
JPOS_FIT_EPTR_OVERHEAT (10006):
The print head is overheated.
(Can be returned only if AsyncMode is false.)
116
validateData Method
Syntax void validateData (int station, String data) throws JposException;
Remarks
Errors
Parameter Description
station PTR_S_RECEIPT(2) is assigned.
data Data to be validated. It includes printable data and escape sequence.
Determines whether a data sequence, possibly including one or more escape sequences, is valid for the specified station, before calling the printImmediate, or printNormal methods.
This method does not cause any printing, but is used to determine the capabilities of the station.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOTCLAIMED (103) An attempt was made to access an exclusive-use device that must be claimed before the method or property set action can be used.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL(106)
JPOS_E_FAILURE(111)
This operation cannot be performed while the device is disabled.
One or more-than-one escape sequences are out of the range, but
Control can select valid alternatives. Or, subject station is not yet supported.
One or more-than-one escape sequences are not supported.
There is no alternative to select.
Cases which cause ErrorCode of JPOS_E_ILLEGAL (106):
For the Escape Sequence not listed below, exception will not be delivered.
Escape Sequence
Paper cut (ESC|#P)
Feed and Paper cut (ESC|#fP)
Underline (ESC|#uC)
Scale horizontally (ESC|#vC)
Condition
The percentage '#' is not precisely supported. (Only 1 to 100 are valid.)
The percentage '#' is not precisely supported. (Only 1 to 100 are valid.)
The thickness '#' is not supported. (Only 1 and 2 are valid.)
The scaling factor '#' is not supported. (Only the values 1 through 8 are valid.)
Scale vertically (ESC|#hC) The scaling factor '#' is not supported. (Only the values 1 through 8 are valid.)
Cases which cause ErrorCode of JPOS_E_FAILURE (111):
Escape Sequence Condition
117
Feed, Paper cut, and Stamp (ESC|#sP) Not supported.
Stamp (ESC|sL) Not supported.
Print bitmap (ESC|#B)
Feed reverse (ESC|#rF)
Bitmap number '#' is out of range. (Only 1 and 2 are valid.)
Not supported.
Font typeface selection (ESC|#fT) Not supported.
Italic (ESC|(!)iC) Not supported.
Alternate color (Custom) (ESC|#rC)
Printing red (ESC|rC)
Shading (ESC|#C)
When the CapRec2Color property is false, it is not supported.
Not supported.
RGB Color (ESC|#rC) Not supported.
Subscript/Superscript (ESC|(!)tpC)
Not supported.
118
3.7. Event
DirectIOEvent Event
Interface jpos.events.DirectIOListener
Method directIOOccurred (DirectIOEvent e);
Description Notifies the application that data that is other than ordinary notification of printer status is received from the printer (including the command status sent by the directIO method). Notification will be given by single byte with the following eventNumber.
Properties This event contains the following properties:
eventNumber
pData
int
int
The ID number of the asynchronous output request that is completed.
The value of received bytes converted to the int type. (e.g. 0x10
-> 16, 0xFF -> 255)
119
ErrorEvent Event
Interface jpos.events.ErrorListener
Description Notifies the application that a printer error has been detected and a suitable response by the application is necessary to process the error condition. This event is delivered only when an error occurs during the asynchronous output.
Properties This event contains the following properties:
errorCode int
errorCodeExtended int
Error Code causing the error event..
Extended Error Code causing the error event.
errorLocus int Location of the error.
errorResponse
If ErrorCode is JPOS_E_EXTENDED, then ErrorCodeExtended has one of the following values:
Value Meaning
JPOS_EPTR_COVER_OPEN (201)
The printer cover is open.
JPOS_EPTR_REC_EMPTY (203)
The receipt station is out of paper.
JPOS_FIT_EPTR_FATAL (10003)
A non-recoverable error has occurred.
JPOS_FIT_EPTR_OVERHEAT (10006)
Head overheat occurred in the printer.
* The latter three errors among the aforementioned errors are defined by the
com.fujitsu.fit.jpos.IFP510Const interface.
The application's error event listener may change ErrorResponse to one of the following values:
Value Meaning
JPOS_ER_RETRY (11) Retry the asynchronous output. The error state is exited. The default.
JPOS_ER_CLEAR (12) Clear the asynchronous output or buffered output data. The error state is exited. (It has same effect as the ClearOutput method)
120
OutputCompleteEvent Event
Interface jpos.events.OutputCompleteListener
Method outputCompleteOccurred (OutputCompleteEvent e);
Description Notifies the application that the queued output request associated with the OutputID property has been completed successfully.
Properties This event contains the following property:
OutputID int The ID number of the asynchronous output request that is completed.
121
StatusUpdateEvent Event
Interface jpos.events.StatusUpdateListener
Description Notifies the application that a printer has had an operation status change.
Properties This event contains the following property:
Status int Indicates the status change.
Value Meaning
PTR_SUE_COVER_OPEN (11) Printer cover is open.
PTR_SUE_COVER_OK (12) Printer cover is closed.
PTR_SUE_REC_EMPTY (24) No receipt paper.
PTR_SUE_REC_NEAREMPTY (25)
Receipt paper is low.
PTR_SUE_REC_PAPEROK(26) Receipt paper is ready.
PTR_SUE_IDLE (1001) All the asynchronous output succeeds, or ends by being deleted.
POS Printer's State is OPOS_S_IDLE(2) now. FlagWhenIdle
Property must be true in order to be notified by this event. And
POS Printer Control automatically sets the property to false before the event notifies it.
JPOS_SUE_POWER_ONLINE (2001)
The device is powered on and ready.
(It notifies at the time of PowerNotify =
OPOS_PN_ENABLED(1))
JPOS_SUE_POWER_OFF_OFFLINE (2004)
The device is not powered on or not connected to the system.
(It notifies at the time of PowerNotify =
OPOS_PN_ENABLED(1))
OPOS_SUE_UF_PROGRESS(2100) + 1 to 100
(1 to 100 indicate the completion percentage)
Specifies the completion percentage of the firmware.
OPOS_SUE_UF_COMPLETE(2200)
The firmware is updated successfully.
OPOS_SUE_UF_FAILED_DEV_OK(2201)
The update firmware process failed but the device is still operational.
122
4. JavaPOS Interface Specifications (Drawer)
4.1. List
Properties
Common Type Access
May Use
After
Initial Value,
Condition
CapCompareFirmwareVersion boolean R open false
CapPowerReporting int R open JPOS_PR_NONE(0)
CapStatisticsReporting boolean
CapUpdateFirmware boolean
CapUpdateStatistics boolean
R/W false
Made writable after open open open false
Made writable after open.
0)
Unwritable
(2000)
DeviceControlDescription String R --- "CashDrawer
Device Control"
DeviceControlVersion int R --- 1010XXX
DeviceServiceDescription String R open "CashDrawer
Device Service"
DeviceServiceVersion int R open 1010XXX
PhysicalDeviceDescription String R open
PhysicalDeviceName String open
"OP CashDrawer "
The device name set in the parameter at the open method.
123
Specific
CapStatus
Type
boolean
Access
R
May Use
After
open
Initial Value,
Condition
The initial value is the value of "CapStatus" in jpos.xml. false CapStatusMultiDrawerDetect boolean R open
* In the Access column, R indicates Read-Only, R/W indicates Read/Write. The item in May Use After is the method and property required for initialization, open indicates the open method, claim indicates the claim method and Enable indicates setting the DeviceEnabled property to true. If required procedure is not executed, JposException may be delivered. When May Use After is open & claim or open, claim & Enable, the property is available for acquisition after the open method is executed, but the value may not be initialized until all open, claim & Enable are executed. To acquire such property, access it after the conditions are met.
124
Methods
Common Initialization open none close open claim open release open & claim checkHealth compareFirmwareVersion open & Enable open & Enable directIO open resetStatistics open & Enable retrieveStatistics updateFirmware open & Enable open & Enable open & Enable updateStatistics
Specific Initialization
open & Enable open & Enable openDrawer waitForDrawerClose
Events
Event
DirectIOEvent
StatusUpdateEvent
Initialization open & Enable open & Enable
125
4.2. Common Properties
The following sections describe the properties provided commonly to the Drawer.
There are two kinds of properties: Read-Only and Read/Write. For the property that is is writable, R/W is added next to the property name.
Only when exception's errorCode has the special meaning, the description is provided.
CapCompareFirmwareVersion Property
Type boolean
Errors device against that of a firmware file.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapPowerReporting Property
Type int
Remarks Identifies the reporting capabilities of the device. It has the following value:
Errors
Value Meaning
JPOS_PR_NONE (0) The device service cannot determine the power.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
126
CapStatisticsReporting Property
Type boolean
Remarks This property is initialized to false by the open method. Statistics reporting is not supported.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapUpdateFirmware Property
Type boolean
Remarks This property is initialized to false by the open method. Statistics reporting is not supported.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapUpdateStatistics Property
Type boolean
Remarks This property is initialized to false by the open method. Statistics reporting is not supported.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
127
CheckHealthText Property
Type String
Remarks
Errors
Holds the results of the most recent call to the checkHealth method. The following examples illustrate some possible diagnoses:
- "Internal HCheck: Successful"
- "External HCheck: Successful"
- "External HCheck: Failure"
- "InteractiveHCheck: Not Supported"
(It succeeded in Internal check.)
(It succeeded in External check.)
(It failed in External check.)
(It is not supported.)
This property is not initialized before the first call to the checkHealth method (empty string ("")).
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
Claimed Property
Type boolean
Remarks
Errors
true: The device is claimed for exclusive access.
false: The device is released for sharing with other applications.
Many devices must be claimed exclusively before the Control will allow access to many of its methods and properties, and before it will deliver events to the application.
The Claimed property is initialized to false by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
DeviceControlDescription Property
Type String
Remarks "JavaPOS CashDrawer Device Control" is set. (The value may vary depending on the DC in use.)
Identifies the Control Object. It is a character string identifying the Control Object and the company that produced it and always readable.
Errors None.
128
DeviceControlVersion Property
Type int
Remarks Holds the Control Object version number. "1010XXX" is set. (XXX indicates the version number.)
This property is always readable.
This property displays the version of DeviceControl implemented in the jcl.jar file. It may differ depending on the environment in use.
Errors None.
PhysicalDeviceDescription Property
Type String
Remarks
Errors
"OP CashDrawer" is set.
It is a character string identifying the device and holds the device name and related information.
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
129
DeviceEnabled Property R/W
Type boolean
Remarks
Errors
true: The device is enabled and in an operational state. If changed to true, then the device is brought to an operational state.
false: The device has been disabled. If it is changed to false, then the device is physically disabled.
Subsequent input is discarded and output operation icanot be executed. Before the device is used, application must set this property true.
This property is initialized to false by the open method.
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_NOHARDWARE (107) POS Printer is OFF or OFFLINE or the cable is not connected.
Clear the problem, and then execute the property again.
JPOS_E_FAILURE (111)
JPOS_E_TIMEOUT (112)
The connection to the device is failed. There is the possibility that the port specified does not exist.
The POS Printer could not be replaced. There is the possibility of cover open or running out of paper.
PhysicalDeviceName Property
Type String
Remarks
Errors
Any of the followings is set: "PT390SERDR1", "PT390SERDR2", "PT390USBDR1", and
"PT390USBDR2",.
The value to be set may vary depending on the device specified by open. This property holds a short name identifying the physical device. This is a short version of PhysicalDeviceDescription and should be limited to 30 characters. This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
130
FreezeEvents Property R/W
Type boolean
Errors
If false, the application allows events to be delivered. If some events have been held while events were frozen during true and all other conditions are correct for delivering the events, then changing this property to false will allow these events to be delivered. An application may choose to freeze events for a specific sequence of code where interruption by an event is not desirable. This property is initialized to false by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
PowerNotify Property R/W
Type int
Remarks Contains the type power notification selection made by the Application.
The power notification values are:
Errors
Value Meaning
JPOS_PN_DISABLED (0) The driver will not provide any power notifications to the application. No power notification StatusUpdateEvents will be fired, and PowerState may not be set
This property is initialized to JPOS_PN_DISABLED(0) by the open method
This property throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106) This property cannot be changed.
131
PowerState Property
Type int
Remarks Identifies the current power condition of the device, if it can be determined.
The power reporting values are:
Errors
Value Meaning
JPOS_PS_UNKNOWN (2000) The device's power state cannot be determined.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
DeviceServiceDescription Property
Type String
Remarks
Errors
Holds the Device Service name and the company that produced it.
It is set to "CashDrawer JavaPOS Device Service"
This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
DeviceServiceVersion Property
Type int
Remarks
Errors
"1010XXX" is set. Holds the Device Serivice version number. (XXX indicates the version number.) This property is initialized by the open method.
This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
132
State Property
Type int
Remarks Holds the current state of the JavaPOS Device.
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_S_IDLE (2)
This property is always readable.
The device is in a good state and is not busy.
133
4.3. Common Methods checkHealth Method
Syntax void checkHealth(int level) throws JposException
The level parameter indicates the type of health check to be performed on the device. The following values may be specified:
Value Meaning
JPOS_CH_INTERNAL(1) Perform a health check that does not physically change the device.
It is always successful and "Internal Hcheck:Successful" is set in the CheckHealthText property.
JPOS_CH_EXTERNAL(2) Perform a more thorough test that may change the device. If possible, it opens the drawer. If drawer is open , "External
HCheck:Successful" is set in the CheckHealthText property.
This method fails when it is accessed exclusively by other application, the power of the printer is off or the printer. is disconnected. If so, "External HCheck:Failure" is set in the
CheckHealthText property
Remarks
Errors
In this case, "Interactive HCheck:Not Supported" is set in the
CheckHealthText property and the exception with error code,
JPOS_E_ILLEGAL(106) will be delivered.
It is called to test the state of a device. The result of this method is stored in the CheckHealthText property. The CheckHealth method is always synchronous
When CapStatus property is set TRUE, CheckHealthMethod waits until Drawer Open status is detected.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_CLAIMED (102) An attempt was made to access a device that is claimed exclusive-use by another application.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
The specified level parameter is not supported.
JPOS_E_NOHARDWARE(107) The POS Printer to which the Drawer is connected is OFF or
OFFLINE. It is stored only when JPOS_CH_EXTERNAL(2) is set.
Drawer Open cannot be detected after timeout period. Only when
JPOS_CH_EXTERNAL(2) is set and CapStatus proper is set
134
TRUE, it will be stored.
135
claim Method
Syntax void claim(int timeout) throws JposException;
The timeout parameter gives the maximum number of milliseconds to wait for exclusive access to be satisfied. If it is zero (0), then the method immediately either returns (if successful) or throws an appropriate exception. If JPOS_FOREVER (-1) is set, the method waits as long as needed until exclusive access is satisfied.
Remarks
Errors
Requires the application to claim for exclusive access to the device before the device can be used.
When successful, the Claimed property is changed to true.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
close Method
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106)
JPOS_E_TIMEOUT (112)
An invalid timeout parameter was specified.
Another application has exclusive access to the device, and did not relinquish control before timeout milliseconds expired. Or, the state of the Device did not become processible after timeout time has passed.
Syntax void close() throws JposException;
Remarks
Errors
Releases the device and its resources.
If the DeviceEnabled property is true, then the device is disabled.
If the Claimed property is true, then exclusive access to the device is released.
This method should not be executed during event processing (in the Event Handler).
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
136
compareFirmwareVersion Method
Remarks
Errors
This method is not supported.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
This method is not supported. JPOS_E_ILLEGAL (106)
directIO Method
Syntax void directIO(int command, int[] data, Object object) throws JposException;
Remarks
Errors
This method is called to communicate directly with the Device Service.
This method is not supported.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106) This method is not valid.
137
open Method
Syntax
Remarks
Errors
void open(String logicalDeviceName) throws JposException;
The logicalDeviceName parameter specifies the device name to open.
The device names of the driver are as follows:
- Serial Interface: "PT390SERDR1, "PT390SERDR2",
"PT390SER2DR1, "PT390SER2DR2"
- USB Interface "PT390USBDR1", "PT390USBDR2",
"PT390USB2DR1", "PT390USB2DR2"
This method is called to open a device.
When the open method is successful, the common properties and other class-specific properties are initialized.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_NOSERVICE (104) A connection to the corresponding Device Service could not be established.
JPOS_E_ILLEGAL (106)
JPOS_E_NOEXIST (109)
The Device Control is already open.
The corresponding Device Service does not exist.
release Method
Syntax void release() throws JposException;
Remarks
Errors
This method is called to release exclusive access to the device.
If the DeviceEnabled property is true and the device is an exclusive-use device, then the device is also disabled. This method should not be executed during event processing (in the Event Handler).
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106)
JPOS_E_BUSY (113)
Exclusive access to the device is not allowed for the application.
This operation cannot be performed while processing is in progress.
138
resetStatistics Method
Syntax void resetStatistics(String statisticsBuffer) throws JposException
Remarks This method is not supported..
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
This method is not supported.. JPOS_E_ILLEGAL (106)
retrieveStatistics Method
Syntax void retrieveStatistics(String[] statisticsBuffer) throws JposException
Remarks This method is not supported..
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
This method is not supported.. JPOS_E_ILLEGAL (106)
updateFirmwareMethod
Syntax void updateFirmware(String firmwareFileName) throws JposException
Remarks This method is not supported..
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106) This method is not supported..
139
updateStatistics Method
Syntax void updateStatistics(String statisticsBuffer) throws JposException;
Remarks This method is not supported..
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_ILLEGAL (106) This method is not supported..
140
4.4. Specific Properties
CapStatus Property
Type Boolean
Remarks true: The drawer can report the open/closed status.
false: The drawer is not able to determine whether cash drawer is open or closed.
The property of the first Drawer define as "XXX[Device Name]DR1" is set to true and The property of the second Drawer define as "XXX[Device Name]DR2" is set to false. The device name contains either "SER (Serial Interface)" or "USB (USB Interface)".
However, evenif the property is true, unless the driver is in the enabled state
(DeviceEnabled=true) for the printer connected to the Drawer, capability of reporting the status of the Drawer is not supported by this property
This property is initialized by the open method.
* Use the second drawer property defined by "XXX[Device Name]DR2" with FALSE.
The 2nd drawer does not support the status notification of drawer open/close.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
CapStatusMultiDrawerDetect Property
Type boolean
Remarks false: The open/closed status unique to each drawer in a multiple cash drawer configuration can be reported limitedly. The DrawerOpened property can determin the following status.
This property is initialized false by the open method.
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
141
DrawerOpened Property
Type Boolean
Remarks ture: The drawer is open.
false: The drawer is closed.
If the capability CapStatus is false, then the device does not support status reporting, and the
DrawerOpened property is always false.
This property is initialized to an appropriate value when the device is enabled.
* Unless the CapStatus property is true, and the driver is in the enabled state
(DeviceEnabled=true) for the printer connected to the Drawer, capability of reporting the status of the Drawer is not supported by this property.
* The open/closed status of second Drawer defined as "XXX[Device Name]DR2" cannot be reported. The device name is either "SER (Serial Interface)" or "USB (USB Interface)".
Errors This property throws a JposException.
The exception's ErrorCode property will be the following value:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
142
4.5. Specific Methods openDrawer Method
Syntax void openDrawer() throws JposException;
Remarks
Errors
Opens the drawer. When CapStatus property is set as TRUE, OpenDrawerMethod waits until the status of Drawer open is detected.When it is being accessed exclusively by other application, this method fails.
This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_CLAIMED (102) An attempt was made to access a device that is claimed exclusive-use by another application.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
JPOS_E_FAILURE (111)
JPOS_E_TIMEOUT(112)
JPOS_E_BUSY (113)
This operation cannot be performed while the device is disabled.
Communication to the device was failed.
The connection to the device is failed. The power of the printer is off or the communication cable is not connected.
Connection is succeeded with printer connected to Drawer, but
Drawer Open cannot be detected after timeout period. When
CapStatus proper is set TRUE, it will be stored.
This operation cannot be performed while processing is in progress.
waitForDrawerClose Method
Syntax
Remarks
void waitForDrawerClose(int beepTimeout, int beepFrequency,
int beepDuration, int beepDelay) throws JposException;
This method is not supported.
Errors This method throws a JposException.
The exception's ErrorCode property will be one of the following values:
Value Meaning
JPOS_E_CLOSED (101) An attempt was made to access a closed device.
JPOS_E_DISABLED (105)
JPOS_E_ILLEGAL (106)
This operation cannot be performed while the device is disabled.
This method is not supported by the Device Service.
143
4.6. Event
DirectIOEvent Event
Interface jpos.events.DirectIOListener
Description This event is not reported.
StatusUpdateEvent Event
Interface jpos.events.StatusUpdateListener
Description Notifies the application that a cash drawer has had an operation status change.
Properties This event contains the following property:
Status int Indicates the status of the cash drawer.
The Status property has one of the following values:
Value Meaning
CASH_SUE_DRAWERCLOSED (0) The drawer is closed.
CASH_SUE_DRAWEROPEN (1) The drawer is open.
* Unless the CapStatus property is true, and the driver is in the enabled state
(DeviceEnabled=true) for the printer connected to the Drawer, capability of reporting the status of the Drawer is not supported.
* Nothing is notified when the device is enabled and Drawer is closed.
“CASH_SUE_DRAWEROPEN(1)" is notified when the device is enabled and Drawer is opened.
144
5. Xml file Configuration
The Device Control reads the following configuration from the jpos.xml file, and starts the Device Service.
Up to the second printer in both Serial and USB can be set to the XML file.
5.1. The explanation of XML items (POS Printer)
Items
JposEntry logicalName creation factoryClass creation serviceClass vendor name vendor url jpos category jpos version product description product name product url prop name="portName" prop name="baudRate" prop name="parity" prop name="dataBits" prop name="stopBits" prop name="flowControl" prop name="vendorID" prop name="productID" prop name="serialNumber" prop name="SendTimeout" prop name="ResetTimeout"
Remarks
The name of the logical device by open.
The factory class of the Device Service.
The class of the Device Service.
The name of vendor.
The URL of vendor.
The device category of JavaPOS.
The version number of JavaPOS.
The description of the product.
The name of the product.
The URL of the product.
The port name.
The baud rate.
The parity.
The baud rate.
The stop bit.
The flow control.
It is fixed to Xon/Xoff.
Th e vendor ID set in the Printer. For PT390, 1724 is used.
Th e product ID set in the Printer. For PT390, 0699 is used.
The serial number when the serial number in the printer setting is set to
"EXTENDED".
If "" (empty string) is set, the printer set to "STANDARD" for the serial number in the printer setting.
The timeout to send (ms).
The period of timeout until JPOS_E_TIMEOUT(112) is delivered after the data cannot be sent to the printer while the data is being sent.
The timeout to reset (ms).
The period of timeout from when the printer start to reboot until when the
Power ON/OFF is detected when the updateFirmware method is executed.
(Only for USB).
145
Items prop name="InvertDrawerStatus" prop name="Smoothing" prop name="RecLineChars" prop name="RecLineCharsList" prop name="RecLineHeight" prop name="RecLineSpacing" prop name="RecLineWidth" prop name="CapRec2Color" prop name="LogLevel" prop name="LogFile" prop name="LogSize" prop name="LogRotation" prop name=" PowerOnNotify " prop name="CodePage"
Remarks
Connection drawer invert flag.
Due to the machine characteristics of the drawer, the POS printer may notify the open/close status reversed. Set '0' for normal operation and set '1' to reverse the status.
Specifies whether to perform smoothing process in the POS printer. For '1', when the RecLetterQuality property is set to true, smoothing process is applied to the font that is equal to or larger than double-width. For '0', regardless the value of the RecLetterQuality property, smoothing process is not applied. (The default value is "1".)
Characters to be printed in a line. Any value of RecLineCharsList is set.
(The default value is "48".)
The list of the number of the characters that can be printed in a line by the
POS printer. According to the conditions for printing, it is set as follows:
Receipt is 83 mm and printing characters are 53 per line: "53,64,80"
Receipt is 80 mm and printing characters are 48 per line: "48,57,72"
Receipt is 80 mm and printing characters are 42 per line: "42,51,64"
Receipt is 60 mm and printing characters are 36 per line: "36,43,54"
Receipt is 58 mm and printing characters are 35 per line: "35,42,52"
Receipt is 58 mm and printing characters are 32 per line: "32,42,52"
The height of the character in the Printer in dot. (Default value is "24")
The spacing between print lines in the POS printer in dot. RecLineHeight to
127 dot can be set. (Default value is "30")
Paper width of the POS printer in dot. According to the conditions for printing, it is set as follows:
Receipt is 83 mm and printing characters are 53 per line: "640"
Receipt is 80 mm and printing characters are 48 per line: "576"
Receipt is 80 mm and printing characters are 42 per line: "512"
Receipt is 60 mm and printing characters are 36 per line: "436"
Receipt is 58 mm and printing characters are 35 per line: "420"
Receipt is 58 mm and printing characters are 32 per line: "384"
Specifies whether 2-color printing is available. When 2-color printing is invalid in the Printer, set to "F". (Default) When 2-color printing is valid, set to "T". In case of PT390, make this value “F”.
Indicates the output level of the log.
Refer to the Chapter 6 "Log File" for the details.
Indicates the output destination of the log file.
Indicates the maximum size of the log file.
Indicates the number of the log file to be created when the log file reaches the maximum size..
Indicates the capability of the Power On report of the Printer. (Regardless the value of the PowerNotify property, it specifies whether the printer send the message when the power is turned on.) When "0" is set, it is invalid, and when "1", it is valid. Because this value is not referred from the driver, the behavior is not affected.
This is the value set in the CharacterSetList property of the POSPrinter.
146
Items prop name="DefaultCodePage" prop name="DataCompress" prop name="ErrorRecoveryMode" prop name="PrintLevel" prop name="PrintSpeed" prop name="BatchPrint" prop name="PNESense" prop name="SerialNo" prop name="ID" prop name="Device" prop name="Func2DBarcode" prop name="FuncPNESense" prop name="FuncConvertKanji" prop name="DefaultFont" prop name=" FuncFontC" prop name=" ErrorAlert"
Remarks
This is the value set in the CharacterSet property of the POSPrinter
Specifies whether to send data after compression on the PrintBitMap property execution. For "ture", it is compressed, and for "false" it is not compressed.
As the default, "false" is set.
Specifies how the error is recovered. "0": when error occurs, data that is not sent is sent again, "1": data that is not sent is discarded and error state is recovered by the command.
As the default, "1" is set.
Specifies the printing thickness. The default's printing level of black is taken as 100 %. The percentage can be set from 70 to 130 by 10 %.
Specifies the printing speed. It can be set to the numbers form 1st to 11th.
The default is set to "11th " that is highest printing speed.
Specifies the batch printing feature. When "D" (Disable) is set, the batch feature is disabled, and when "E" (Enabled) is set, the batch feature is enabled.
"D" (Disabled) is set as the default setting.
Specifies whether to notify low paper. When it is set to "E" (enabled), notification is executed. When it is set to "D" (disabled), notification is not executed."E" (enabled) is set as the default setting.
Specifies the response contents of the serial number. When "N" (Standard) is set, it respond with 30H, and when "E" (Extended) is set, it respond with the serial number written inWhen multiple printers are connected to USE parallel interface, set to "E" (Extended) to distinguish them."N" (Standard) is set as the default setting.
The identifier to share the port. This setting should not be changed.
Specifies the communication method between the device and the host. "1" is for the serial interface connection, and "3" is or the USB interface connection.
This setting should not be changed
2D Barcode function. This is a peculiar setting of each printer. Please do not change. (1:Enable, 0:Disable)
PNE Sense function. This is a peculiar setting of each printer. Please do not change. (1:Enable, 0:Disable))
This setting is whether to convert Kanji character code in JIS at
CharacterSet=932. This is a peculiar setting of each printer. Please do not change. (1:JIS Kanji installed, 0:Uninstalled)
Default font setting. This is a peculiar setting of each printer. Please do not change. ("A":Font A, "B":Font B)
This setting is whether to install font C. This is a peculiar setting of each printer. Please do not change. (1:Font C installed, 0:Uninstalled)
Specifies the warning method with the buzzer when the error occers.
When “D” is set, the buzzer doesn't beep when the printer error occurs.
When "E" is set, the buzzer beeps when the printer error occurs.
147
Items prop name=" BuzzerInterval" prop name=" BuzzerRepetition"
Remarks
Specifies the beeping interval of the buzzer.
The value shows the pattern number. The value can be set from 1(Pattern 1) to 5(Pattern 5)
Specifies the repetition frequency of the buzzer.
The repetition frequency of the buzzer can be set from 0 (None) to 5 (Five).
148
5.2. The explanation of XML items (Drawer)
Items
JposEntry logicalName creation factoryClass creation serviceClass vendor name vendor url jpos category jpos version product description product name product url prop name="portName" prop name="baudRate" prop name="parity" prop name="dataBits" prop name="stopBits" prop name="flowControl" prop name="vendorID" prop name="productID" prop name="serialNumber" prop name="CapStatus" prop name="DrawerNo" prop name="OffTimer" prop name="OnTimer" prop name="ID" prop name="Device" prop name="SendTimeout"
Remarks
The name of the logical device by open.
The factory class of the Device Service.
The class of the Device Service.
The name of vendor.
The URL of vendor.
The device category of JavaPOS.
The version number of JavaPOS.
The description of the product.
The name of the product.
The URL of the product.
The port name.
The baud rate.
The parity.
The baud rate.
The stop bit.
The flow control.
Th e vendor ID set in the Printer. For PT390, 1724 is used.
Th e product ID set in the Printer. For PT390, 0699 is used.
The serial number when the serial number in the printer setting is set to
"EXTENDED".
If "" (empty string) is set, the printer set to "STANDARD" for the serial number in the printer setting.
Supports the open/close status of the Drawer. ("ture" is supported, and
"false" is not supported.)
This value should not be changed
The number of the Drawer. (1 or 2)
The drawer kick on time (ms)
The drawer kick off time (ms)
The identifier to share the port. This setting should not be changed.
Specifies the communication method between the device and the host.
"1" is for the serial interface connection, and "3" is or the USB interface connection.
This setting should not be changed
The timeout to send (ms).
The period of timeout until JPOS_E_TIMEOUT(112) is delivered after the data cannot be sent to the printer while the data is being sent.
149
Items prop name="ResetTimeout" prop name="DrawerOpenTimeout"
Remarks
The timeout to reset (ms).
The period of timeout from when the printer start to reboot until when the Power ON/OFF is detected when the updateFirmware method is executed. (Only for USB).
External Check (CheckHealthMethod)、Timeout period of Drawer open detection used by OpenDrawer Method(ms)
150
6. Log Files
The Device Control has the function to output the log files. Setting prop name = "LogLevel" to the value from "0" thorough "3" will determines output of a log file.
The output levels of log and the results are provided in the table below. When a log is output, the java.util.logging package, the standard package of Java, is used. The operations described in the table represent the log levels in java.util.logging package. The output format is the format of the java.util.logging package generally.
Operation Level
0
1
Outputs no log.
(OFF)
Outputs a log when a severe error occurs. This is for future extension, and if this level is assigned, a log will be output when the operation of the thread fails.
(SEVERE)
2
3
Outputs a log when a warning (such as general exceptions) is issued.
(WARNING)
Outputs a information log. The methods of the Device Service that are executed and the data that are sent and received are provided.
(INFO)
151
7. Using Multiple Printers
The PT390 JavaPOS Printer Driver can use two of a serial and USB simultaneously.
In Windows, two of a serial can be used simultaneously.
Serial
JavaPOS Printer Driver
USB
Printer Drawer Printer Drawer
The printer of two with a different interface can be connected.
Drawer Drawer
Serial (USB)
JavaPOS Printer Driver
Serial (USB)
Printer Drawer Printer Drawer
The printer of two with a same interface can be connected.
Drawer Drawer
* When you set two or more printers, connect printer one by one, and set it with the setup tool.
* The printer might not print correctly depending on PC or USB port when two printers are connected in USB interface. Please use the printer after confirming the correct print.
152
8. Replacement of printer
In case of Serial and USB interface, the replacement of the printer is completed only by connecting a new printer after the application is ended, and executing the application again. (After the Close method is issued, the Open method and the ClaimDevice method are issued, and the DeviceEnabled property is changed into TRUE.)
The setup tool need not be used.
Note: The printer connected with XXXUSBPRT cannot be replaced with XXXUSB2PRT. This opposite cannot be done. The purpose is to prevent the replacement of the printer from happening by mistake at two USB connection.
When you want to replace it, connect printer one by one, and set it with the setup tool.
Note: When replacing USB printer to another USB one, depending on the environment of PC, JPOS_E_TIMEOUT may occur to take time to recognize the USB device. And when you connect new printer, USB device driver install wizard may be displayed. Change the DeviceEnabled property into TRUE again, after finishing this wizard (*1).
*1: When the printer is connected to PC in USB interface and "Found New Hardware Wizard" was displayed, set it in the following procedures.
For Windows 7 / Server 2008 R2
1. The message "Installing device driver software" is displayed in a balloon(lower right corner of the screen).
2. After a while, the message "Device driver software was not successfully installed" is displayed.
This is not a problem.
For Windows Vista / Server 2008
1. The "Found New Hardware" is displayed, select [Don't show this message again for this device].
* When "User Account Control" screen is displayed, select [Continue].
For Windows XP / Server 2003 / WEPOS / WEPOS2009
1. The "Found New Hardware Wizard" screen is displayed. Select [No, not this time] and then click
[Next].
2. When "What do you want the wizard to do?" is displayed, select [Install from a list or specific location]
and then click [Next].
3. Select [Search for the best driver in these locations], clear all checkboxes and then click [Next].
4. When "Cannot Install this Hardware" is displayed, click [Don't prompt me again to install this software] and then click [Finish].
For Windows 2000
1. The "Found New Hardware Wizard" screen is displayed, click [Next].
2. When "What do you want the wizard to do?" is displayed, select [Search for a suitable driver for my device] and then click [Next].
3. When [Locate Driver Files] is displayed, clear all checkboxes and then click [Next].
4. When "Driver Files Search Results" is displayed, select [Disable the device] and then click [Finish].
153
Revision History
Revision # Date
1.0 June 29, 2011
Revised Content
First officially released to support JavaPOS 1.10.
1.1
1.2
1.3
July 4, 2011
July 8, 2011
3.2 Print Data and Escape Sequences
- Description of PDF417 is added.
3.6 Specific Methods printBarCode Method
- Description of PDF417 is added.
- Description of 2coloers barcode width are added.
1.Outline
- Description of “Package Configuration” is deleted.
5. Xml file Configuration
- Example of regitory is deleted.
6. Log Files
- Example of log output is deleted.
March 7, 2012 1.6. Setting Program Usage
- The image of Setting program is changed.
5.1. The explanation of XML items (POS Printer)
- Description of print speed is changed.
154
Oki contact details
OkicontactName. Oki Systems
(UK) Limited
OkicontactAddress.550 Dundee Road
Slough Trading Estate
Slough
Berkshire
SL1 4LE
Oki Systems (Iberica), S.A.U
C/Teide, 3
San Sebastian de los Reyes
28703, Madrid
Tel:+34 91 3431620
Fax: +34 91-3431624
Atención al cliente: 902 36 00 36
Website: www.oki.es
Tel:+44 (0) 1753 819819
Fax:+44 (0) 1753 819899 http://www.oki.co.uk
Oki Systems Ireland Limited
The Square Industrial Complex
Tallaght
Dublin 24
Oki Systèmes (France) S.A.
44-50 Av. du Général de Gaulle
94246 L'Hay les Roses
Paris
Tel:+33 01 46 15 80 00
Télécopie:+33 01 46 15 80 60
Website: www.oki.fr
Tel:+353 (0) 1 4049590
Fax:+353 (0)1 4049591 http://www.oki.ie
Oki Systems Ireland Limited -
Northern Ireland
19 Ferndale Avenue
Glengormley
BT36 5AL
Northern Ireland
OKI Systems (Magyarország) Kft.
Capital Square
Tower 2
7th Floor
H-1133 Budapest,
Váci út 76
Hungary
Tel:+44 (0) 7767 271447
Fax:+44 (0) 1 404 9520 http://www.oki.ie
Telefon: +36 1 814 8000
Telefax: +36 1 814 8009
Website: www.okihu.hu
Technical Support for all Ireland:
Tel:+353 1 4049570
Fax:+353 1 4049555
E-mail: [email protected]
OKI Systems (Czech and Slovak), s.r.o.
IBC – Pobřežní 3
186 00 Praha 8
Czech Republic
Tel: 01805/6544357**
01805/OKIHELP**
Fax: +49 (0) 211 59 33 45
Website: www.okiprintingsolutions.de
**0,14€/Minute aus dem dt. Festnetz der T-Com (Stand 11.2008)
OKI Systems (Italia) S.p.A.
via Milano, 11,
20084 Lacchiarella (MI)
Tel:+39 (0) 2 900261
Fax:+39 (0) 2 90026344
Website: www.oki.it
OKI Printing Solutions
Platinium Business Park II, 3rd Floor ul. Domaniewska 42
02-672 Warsaw
Poland Tel: +420 224 890158
Fax:+420 22 232 6621
Website: www.oki.cz, www.oki.sk
Oki Systems (Deutschland) GmbH
Hansaallee 187
40549 Düsseldorf
Tel:+48 22 448 65 00
Fax:+48 22 448 65 01
Website: www.oki.com.pl
E-mail: [email protected]
Hotline: 0800 120066
E-mail: [email protected]
Oki Systems (Ibérica) S.A.
Sucursal Portugal
Edifício Prime -
Av. Quinta Grande 53
7º C Alfragide
2614-521 Amadora
Portugal
Διανομέας των συστημάτων OKI
CPI S.A1 Rafailidou str.
177 78 Tavros
Athens
Greece
Tel:+351 21 470 4200
Fax:+351 21 470 4201
Website:www.oki.pt
E-mail : [email protected]
Tel: +30 210 48 05 800
Fax:+30 210 48 05 801
EMail:[email protected]
Oki Service
Serviço de apoio técnico ao
Cliente
Tel: 808 200 197
E-mail : [email protected]
OKI Europe Ltd. (Russia)
Office 702, Bldg 1
Zagorodnoye shosse
117152, Moscow
Tel: +74 095 258 6065
Fax: +74 095 258 6070 e-mail: [email protected]
Website: www.oki.ru
Technical support:
Tel: +7 495 564 8421 e-mail: [email protected]
Oki Systems (Österreich)
Campus 21
Businesszentrum Wien Sued
Liebermannstrasse A02 603
22345 Brun am Gebirge
Tel: +43 223 6677 110
Drucker Support:
+43 (0) 2236 677110-501
Fax Support:
+43 (0) 2236 677110-502
Website: www.oki.at
OKI Europe Ltd. (Ukraine)
Raisy Opkinoy Street,8
Building B, 2nd Floor,
Kiev 02002
Ukraine
Tel: +380 44 537 5288 e-mail: [email protected]
Website: www.oki.ua
OKI Sistem ve Yazıcı Çözümleri
Tic. Ltd. Şti.
Harman sok Duran Is Merkezi,
No:4, Kat:6,
34394, Levent
İstanbul
Tel: +90 212 279 2393
Faks: +90 212 279 2366
Web: www.oki.com.tr
www.okiprintingsolutions.com.tr
Oki Systems (Belgium)
Medialaan 24
1800 Vilvoorde
Helpdesk: 02-2574620
Fax: 02 2531848
Website: www.oki.be
AlphaLink Bulgaria Ltd.
2 Kukush Str.
Building "Antim Tower", fl. 6
1463 Sofia, Bulgaria tel: +359 2 821 1160 fax: +359 2 821 1193
Website: http://bulgaria.oki.com
OKI Printing Solutions
Herstedøstervej 27
2620 Albertslund
Danmark
Adm.: +45 43 66 65 00
Hotline: +45 43 66 65 40
Salg: +45 43 66 65 30
Fax: +45 43 66 65 90
Website: www.oki.dk
Oki Systems (Finland) Oy
Polaris Capella
Vänrikinkuja 3
02600 Espoo
Tel: +358 (0) 207 900 800
Fax: +358 (0) 207 900 809
Website: www.oki.fi
Oki Systems (Holland) b.v.
Neptunustraat 27-29
2132 JA Hoofddorp
Helpdesk: 0800 5667654
Tel:+31 (0) 23 55 63 740
Fax:+31 (0) 23 55 63 750
Website: www.oki.nl
Oki Systems (Norway) AS
Tevlingveien 23
N-1081 Oslo
Tel:+47 (0) 63 89 36 00
Telefax:+47 (0) 63 89 36 01
Ordrefax:+47 (0) 63 89 36 02
Website: www.oki.no
General Systems S.R.L.
(Romania)
Sos. Bucuresti-Ploiesti Nr. 135.
Bucharest 1
Romania
Tel: +40 21 303 3138
Fax: +40 21303 3150
Website: http://romania.oki.com
Var vänlig kontakta din Återförsäljare i första hand, för konsultation. I andra hand kontakta
Oki Systems (Sweden) AB
Borgafjordsgatan 7
Box 1191
164 26 Kista
Tel. +46 (0) 8 634 37 00 e-mail: [email protected] för allmänna frågor om
Oki produkter [email protected] för teknisk support gällandes Oki produkter
Vardagar: 08.30 - 12.00,
13.00 - 16.00
Website: www.oki.se
Oki Systems (Schweiz)
Baslerstrasse 15
CH-4310 Rheinfelden
Support deutsch +41 61 827 94 81
Support français +41 61 827 94 82
Support italiano +41 061 827 9473
Tel: +41 61 827 9494
Website: www.oki.ch
Oki Systems (Thailand) Ltd.
1168/81-82 Lumpini Tower,
27th Floor Rama IV Road
Tungmahamek, Sathorn
Bangkok 10120
Tel:(662) 679 9235
Fax:(662) 679 9243/245 http://www.okisysthai.com
Oki Data Americas Inc.(United
States)
2000 Bishops Gate Blvd.
Mt. Laurel, NJ 08054
USA
Oki Systems (Hong Kong) Ltd.
Suite 1908, 19/F, Tower 3,
China Hong Kong City
33 Canton Road, TsimShaTsui,
Kowloon, Hong Kong
Tel: 1-800-654-3282
Fax: 1-856-222-5247 http://WWW.OKIPRINTINGSOLUTIONS.COM http://my.okidata.com
Oki Data Americas Inc.(América
Latina (OTRO))
2000 Bishops Gate Blvd.
Mt. Laurel, NJ 08054
USA
Tel: (852) 3543 9288
Fax: (852) 3549 6040 http:// www.okiprintingsolutions.com.hk
Oki Data Americas Inc.(Canada •
Canadá)
4140 B Sladeview Crescent Units 7&8
Mississauga, Ontario
Canada L5L 6A1
Oki Data(Australia) Pty Ltd.
Tél: 1-905-608-5000
Téléc: 1-905-608-5040 http://WWW.OKIPRINTINGSOLUTIONS.COM
Levwl1 67 Epping Road, Macquarie Park
NSW 2113, Australia
Tel: +61 2 8071 0000
(Support Tel: 1800 807 472)
Fax: +61 2 8071 0010 http://www.oki.com.au
Comworth Systems Ltd.
8 Antares Place Mairangi Bay,
Auckland, New Zealand
Tel:(64) 9 477 0500
Fax:(64) 9 477 0549 http://www.comworth.co.nz
Tel (Español): 1-856-222-7496
1-856-222-5276
Fax: 1-856-222-5260
Email: [email protected]
Oki Data de Mexico, S.A. de C.V.
Mariano Escobedo #748, Piso 8
Col. Nueva Anzures
C.P. 11590, México, D.F.
Oki Data(S) P Ltd. Malaysia Rep
Office
Suite 21.03, 21st Floor Menara IGB,
Mid Valley City,
Lingkaran Syed Pura 59200,
Kuala Lumpur, Malaysia
Tel: (60) 3 2287 1177
Fax: (60) 3 2287 1166
Tel: 52-555-263-8780
Fax: 52-555-250-3501 http:// WWW.OKIPRINTINGSOLUTIONS.COM
Oki Data do Brasil, Ltda.
Rua Avenida Alfrefo Egidio de souza Aranha
100-4° andar-Bloco C Chacara Santo Antonio
Sao Paulo, Brazil 04726-170
Tel: 55-11-3444-6747 (Grande São
Paulo)
0800-11-5577 (Demais localidades)
Fax: 5511-3444-3501 e-mail: [email protected]
http://WWW.OKIPRINTINGSOLUTIONS.COM
Oki Data (Singapore) Pte. Ltd.
438A Alexandra Road #02-11/12,
Lobby 3, Alexandra Technopark
Singapore(119967)
Tel:(65) 6221 3722
Fax:(65) 6594 0609 http://www.okidata.com.sg
Oki Data Corporation
4-11-22 Shibaura, Minato-ku,Tokyo
108-8551, Japan
www.okiprintingsolutions.com
Download
Advertisement