background image

 

 

24 

CITIZEN UWP POS Print SDK - Programming Manual 

Configure Capabilities 

Open Package.appxmanifest in the Solution Explorer and open "Capabilities" tab (see below), check 
"Bluetooth", "Internet (Clients)" and "Private Networks (Client & Server)". 

 

 

Adding Namespace 

A reference to the name space "com.citizen.sdk" must be stated at the top of the program source code. 
 

In the case of C#: 

using com.citizen.sdk; 

 

In the case of Basic: 

Imports com.citizen.sdk 

Содержание CT-801II Series

Страница 1: ...UWP POS Print SDK Programming Manual For Ver 2 00...

Страница 2: ...orted models Added 3 3 About printing UTF 8 encode characters Jul 28 2021 2 00 Added CT D101 CT E301 CT E601 and CT D151 L CT E651 L to supported models page 8 11 SDK supports USB host interface and l...

Страница 3: ...lting from operation regardless of the above item 3 5 If you do not agree with the above terms you are not permitted to use this Library Trademark Microsoft Windows Visual Studio Visual Basic Visual C...

Страница 4: ...ntBarCodeAsync method 41 2 3 12 PrintPDF417Async method 43 2 3 13 PrintQRCodeAsync method 44 2 3 14 PrintGS1DataBarStackedAsync method 45 2 3 15 CutPaperAsync method 46 2 3 16 UnitFeedAsync method 47...

Страница 5: ...10 SetCursorPositionAsync method 87 3 3 11 MoveCursorAsync method 88 3 3 12 SetCursorTypeAsync method 89 3 3 13 InitializeDisplayAsync method 90 3 3 14 DisplayDataAsync method 91 3 3 15 SetEncoding me...

Страница 6: ...6 CITIZEN UWP POS Print SDK Programming Manual 4 4 1 Logging function 112 4 4 2 List of Constants Predefined 113...

Страница 7: ...will locate these files automatically when an application is built Supported operating systems This SDK supports the following Microsoft Windows operating systems Windows 10 x86 or x64 ARM is not supp...

Страница 8: ...S310II Series CT S310II Wired LAN Standard CT S601 651 801 851 Series CT S601 651 801 851 Wired Wireless LAN Standard CT S801 851 M Blackmark paper is supported CT S801 L Label paper is supported CT...

Страница 9: ...Err Close 4 8 Partial Only Invalid 5 2 Line Pitch 1 360 6 1 Act For Driver Valid 9 1 Code page Katakana 1 9 2 Int Char Set Japan 1 9 4 Multi byte Char 2 SJIS CP932 GB18030 EUC Hangul BIG5 CT D150 Seri...

Страница 10: ...age Katakana 1 9 2 Int Char Set Japan 1 9 4 Multi byte Char 2 SJIS CP932 GB18030 EUC Hangul BIG5 13 6 Auto Reconnect When Bluetooth I F is used Invalid CT E301 Series Memory Switch Setting MSW No Func...

Страница 11: ...ana 1 9 2 Int Char Set Japan 1 9 4 Multi byte Char 2 SJIS CP932 GB18030 EUC Hangul BIG5 CT E601 Series Memory Switch Setting MSW No Function Setting 1 1 Power ON Info Valid 1 2 Buffer Size 4K bytes 1...

Страница 12: ...Set Japan 1 9 4 Multi byte Char 2 SJIS CP932 GB18030 EUC Hangul BIG5 13 6 Auto Reconnect When Bluetooth I F is used Invalid CT S251 Series Memory Switch Setting MSW No Function Setting 1 1 Power ON I...

Страница 13: ...ana 1 9 2 Int Char Set Japan 1 9 3 Kanji ON 1 9 4 JIS Shift JIS Shift JIS 1 13 6 Auto Reconnect When Bluetooth I F is used Invalid CT S310II Series Memory Switch Setting MSW No Function Setting 1 1 Po...

Страница 14: ...t Japan 1 9 3 Kanji ON 1 9 4 JIS Shift JIS Shift JIS 1 10 3 ACK output timing Before BUSY CT S601II 651II 801II 851II Series Memory Switch Setting MSW No Function Setting 1 1 Power ON Info Valid 1 2 B...

Страница 15: ...age Katakana 1 9 2 Int Char Set Japan 1 9 4 Multi byte Char 2 SJIS CP932 GB18030 EUC Hangul BIG5 HKSCS 13 6 Auto Reconnect When Bluetooth I F is used Invalid CT S2000 Series Memory Switch Setting MSW...

Страница 16: ...Busy condition Full 1 4 Receiving Error Print 1 5 CR Mode Ignored 2 2 Auto cutter Valid 2 4 Full Col Print Wait Data 3 1 Resume Cttr Err Valid 3 7 CBM1000 Mode Valid 3 8 Resume Open Err Close 4 8 Par...

Страница 17: ...g Manual Series The firmware of a printer with older than followings it is necessary to update the firmware Model Firmware Version CT S601 DL00 2000 or newer CT S651 DM00 2000 or newer CT S801 DH00 20...

Страница 18: ...that the scanner to be connected is set as follows For the setting procedure refer to the instruction manual of the peripheral device to be used Item Value Description Interface USB HID Class Communic...

Страница 19: ...he basic operation refer to the instruction manual of the interface board of the printer Please connect to each printer from web browser and display the following Service screen You can set the servic...

Страница 20: ...struction 1 Close Visual Studio if you are using it 2 Open CITIZEN_UWP_POS_SDK vsix the installer where represents its version 3 Click Install on the VSIX Installer window 4 Click Close 5 Start Visual...

Страница 21: ...21 CITIZEN UWP POS Print SDK Programming Manual and the Extensions and Updates dialog will be opened If CITIZEN UWP POS Print SDK is listed in this dialog UWP POS Print SDK is installed successfully...

Страница 22: ...rogramming Manual 1 7 Definition method Adding Library In your Universal Windows application project in the Solution Explorer window right click the References and click Add Reference Then the Referen...

Страница 23: ...tensions on the left side tree and installed extensions are listed in the Reference Manager Check CITIZEN UWP POS Print SDK in this list and click OK Then CITIZEN UWP POS Print SDK will be registered...

Страница 24: ...Explorer and open Capabilities tab see below check Bluetooth Internet Clients and Private Networks Client Server Adding Namespace A reference to the name space com citizen sdk must be stated at the to...

Страница 25: ...SCPOSConst CMP_TXT_1WIDTH ESCPOSConst CMP_TXT_2HEIGHT await printer PrintTextAsync 123456789012345678901234567890 n ESCPOSConst CMP_ALIGNMENT_RIGHT ESCPOSConst CMP_FNT_DEFAULT ESCPOSConst CMP_TXT_1WID...

Страница 26: ...2D GS1DataBar PrintGS1DataBarStackedAsync method Prints a 2 dimensional GS1DataBar barcode 14 Cut paper CutPaperAsync method Cuts the paper 15 Feed dot units UnitFeedAsync method Feeds the paper forwa...

Страница 27: ...print area of page mode 3 PageMode print direction PageModePrintDirection property R W Shows the print direction of page mode 4 PageMode horizontal positon PageModeHorizontalPosition property R W Sho...

Страница 28: ...onnecting to the device CMP_E_CONNECT_OFFLINE 1005 Failed to check the printer status after connecting to the device CMP_E_ILLEGAL 1101 Unsupported operation with the Device or an invalid parameter va...

Страница 29: ...DK Programming Manual 2 3 2 Constructor Syntax ESCPOSPrinter Parameter Not exist Description It is the constructor for this library It creates an instance Return value Not exist Example ESCPOSPrinter...

Страница 30: ...r is not necessary must execute the DisconnectAsync method to disconnect the printer connection When not disconnect the next connection will be an error An application with this SDK connects to a Blue...

Страница 31: ...printer is out of paper 3 Auto Cutter Error occurred due to paper jam etc 4 Unrecoverable error occurred due to circuit failure etc Example await printer ConnectAsync ESCPOSConst CMP_PORT_WiFi 192 16...

Страница 32: ...st Description This method is used to disconnect the printer connection When the end of the print or errors occur please disconnect the connection by the execution of this method Return value Return C...

Страница 33: ...instance it is initialized to the default character set of the OS Please set the encoding by the setting of the memory switch of the printer Please refer to 1 3 Supported models This SDK supports pri...

Страница 34: ...has occurred In this case please reconnect using the DisconnectAsync method and the ConnectAsync method If you want to print after the connected and some time passed please check the status of the pr...

Страница 35: ...tatus that matches Status type can be specified in combination If you want to combine please specify the logical sum Return value Return the following status codes Status codes Description CMP_STS_NOR...

Страница 36: ...CITIZEN UWP POS Print SDK Programming Manual int status3 printer Status ESCPOSConst CMP_STS_DRAWER_LEVEL_H if ESCPOSConst CMP_STS_DRAWER_LEVEL_H status3 0 Status of pin 3 of drawer kick out connector...

Страница 37: ...mes width CMP_TXT_7WIDTH 7 times width CMP_TXT_8WIDTH 8 times width CMP_TXT_1HEIGHT 1 times height CMP_TXT_2HEIGHT 2 times height CMP_TXT_3HEIGHT 3 times height CMP_TXT_4HEIGHT 4 times height CMP_TXT_...

Страница 38: ...bytes IN Byte array representation of the bitmap width IN Bitmap width CMP_BM_ASIS Print the bitmap with one bitmap pixel per printer dot Other Values Bitmap width expressed Expressed in the unit of m...

Страница 39: ...CMD_RASTER Raster command output Suitable for small data printing In order to output the data collectively there is a height limit 2 304 dots 28cm approximately CMP_BM_MODE_CMD_BITIMAGE Bit image comm...

Страница 40: ...f utility software for the printer Registration mode varies among the model of the printer Please register as follows CT S281 Please register the logo with Unused key code mode To the image number to...

Страница 41: ...ots Expressed in the unit of measure given by MapMode default dots width IN Barcode horizontal size magnification 2 6 dots Expressed in the unit of measure given by MapMode default dots alignment IN B...

Страница 42: ...urn value Return CMP_SUCCESS 0 in success Please refer to 2 3 1 Return value for the error code except it Example await printer PrintBarCodeAsync 123456789012 ESCPOSConst CMP_BCS_UPCA 50 2 ESCPOSConst...

Страница 43: ...CMP_PDF417_EC_LEVEL_5 Level 5 CMP_PDF417_EC_LEVEL_6 Level 6 CMP_PDF417_EC_LEVEL_7 Level 7 CMP_PDF417_EC_LEVEL_8 Level 8 alignment IN Barcode alignment CMP_ALIGNMENT_LEFT Left alignment CMP_ALIGNMENT_C...

Страница 44: ...ignment CMP_ALIGNMENT_LEFT Left alignment CMP_ALIGNMENT_CENTER Center alignment CMP_ALIGNMENT_RIGHT Right alignment Other Values Distance from the left most print column to the start of the barcode Ex...

Страница 45: ...t dots alignment IN Barcode alignment CMP_ALIGNMENT_LEFT Left alignment CMP_ALIGNMENT_CENTER Center alignment CMP_ALIGNMENT_RIGHT Right alignment Other Values Distance from the left most print column...

Страница 46: ...ype CMP_CUT_FULL Full cut CMP_CUT_PARTIAL Partial cut CMP_CUT_FULL_PREFEED After feed the paper to the cutting position full cut CMP_CUT_PARTIAL_PREFEED After feed the paper to the cutting position pa...

Страница 47: ...he parameters are as follows Value IN OUT Meaning Setting range ufCount IN Number of paper feed Expressed in the unit of measure given by MapMode default dots Description This method is used to feed t...

Страница 48: ...type of label paper or black mark paper CMP_MF_TO_CUTTER After feed the paper to the Auto Cutter cutting position cut further CMP_MF_TO_NEXT_TOF Feed the paper to the next paper s top of form Descrip...

Страница 49: ...s Value IN OUT Meaning Setting range drawer IN Cash drawer number CMP_DRAWER_1 Drawer 1 CMP_DRAWER_2 Drawer 2 pulseLen IN Signal length 1 8 x 100 msec Description This method is used to open the cash...

Страница 50: ...is printed The entire transaction is treated as one message Calling the ClearOutputAsync method cancels transaction mode Any buffered print lines are also cleared Return value Return CMP_SUCCESS 0 in...

Страница 51: ...g methods are printed also rotated PrintBarcodAsync PrintPDF417Async PrintQRCodeAsync PrintGS1DataBarStackedAsync and or PrintBitmapAsync If rotation is CMP_RP_NORMAL then rotation mode is exited Retu...

Страница 52: ...hen the buffered data is saved and printed This control is used to print the same page layout with additional print items inside of the page If control is PTR_PM_NORMAL then Page Mode is exited If som...

Страница 53: ...et print area of Page Mode printer SetPageModePrintArea 184 0 120 800 await printer PrintTextAsync 299 99 n ESCPOSConst CMP_ALIGNMENT_CENTER ESCPOSConst CMP_FNT_UNDERLINE ESCPOSConst CMP_FNT_BOLD ESCP...

Страница 54: ...Syntax int ClearPrintArea Parameter Not exist Description This method is used to clear the area defined by the PageModePrintArea property Return value Return CMP_SUCCESS 0 in success Please refer to 2...

Страница 55: ...clear all buffered output data by TransactionPrintAsync method and PageModePrintAsync method Also when possible halts outputs that are in progress At the same time the command to clear print data on t...

Страница 56: ...ption This method is used to send data bytes to the printer directly It is usually not necessary please use if you want to send ESC commands directly to the printer If you want to use please be carefu...

Страница 57: ...l cut 1 99 Full cut 0 100 Bitmap print ESC B 1 20 Bitmap image number that is stored in the flash memory of the printer After Bitmap printing print position returns to the initial state left justified...

Страница 58: ...e method Syntax int GetVersionCode Parameter Not exist Description This method is used to get a numerical value for the version number of this SDK Return value Return a numerical value for the version...

Страница 59: ...sionName method Syntax string GetVersionName Parameter Not exist Description This method is used to get a string for the version number of this SDK Return value Return a string for the version number...

Страница 60: ...each watermark 0 65 535 dots Expressed in the unit of measure given by MapMode default dots repeat IN The print number of times of the watermark 0 Infinite repetition 1 65 535 The repetition number of...

Страница 61: ...ut is specified to the value in millisecond Description This method is used to set the timeout to check the print completion notification When you create an instance the timeout is initialized to 0 Pl...

Страница 62: ...Value IN OUT Meaning Setting range mode IN Log mode 0 No Record 1 Recording of access history 2 Error only record path IN Store folder Relative path from LocalFolder maxSize IN Log size 0 No size lim...

Страница 63: ...eries 432 1662 CT S281 Series 384 938 CT D101 150 151 CT E301 351 601 651 CT S310II 601 651 801 851 601II 651II 801II 851II 751 2000 Series 576 1662 CT S4000 4500 Series 832 1662 For example if the st...

Страница 64: ...he next line Any text or image written beyond the bottom of the print area will be truncated For example if the string is 50 100 200 400 then the station print area is a rectangle beginning at the poi...

Страница 65: ...o bottom starting at the top right position of the print area i e rotated right 90 printing Setting this property may also change PageModeHorizontalPosition and PageModeVerticalPosition Setting this p...

Страница 66: ...this property will return the horizontal position offset set by the last write set and not the current position The ConnectAsync method must be complete before accessing this property This property i...

Страница 67: ...ty A read get on this property will return the vertical position offset set by the last write set and not the current position The ConnectAsync method must be complete before accessing this property T...

Страница 68: ...current line spacing a multi high print line might exceed this value In this case the whitespace is zero The ConnectAsync method must be complete before accessing this property This property is initi...

Страница 69: ...hod moduleSize alignment PrintGS1DataBarStackedAsync method moduleSize maxSize alignment UnitFeedAsync method ufCount WatermarkPrintAsync method pass feed PageModeArea property PageModePrintArea prope...

Страница 70: ...o the end of printing is decided by its contents automatically Some print data makes timeout error every time In such case use SetPrintCompletionTimeout method to modify timeout by its printing time 2...

Страница 71: ...1 Print text 2 2019 12 24 13 31 50 634 9636 011 METHOD result PrintTextAsync Success 0 Example to set to properties 2019 12 24 13 35 23 021 4488 008 PROPERTY set RecLineSpacing 24 Success 0 Example to...

Страница 72: ...els don t support interoperating East Asian legacy double byte character sets for Japanese Korean Simplified and Traditional Chinese The available language for printing is depending on the encoding se...

Страница 73: ...h 4 Status CMP_STS_NORMAL int 0 Normal CMP_STS_DRAWER_LEVEL_H int 2 Status of pin 3 of drawer kick out connector H CMP_STS_PAPER_NEAREMPTY int 4 Paper near empty CMP_STS_COVER_OPEN int 16 Cover opens...

Страница 74: ...1 DataBar Expanded CMP_BCS_GS1DATABAR_S int 133 GS1 DataBar Stacked CMP_BCS_GS1DATABAR_E_S int 134 GS1 DataBar Expanded Stacked CMP_BCS_GS1DATABAR_T int 135 GS1 DataBar Truncated CMP_BCS_GS1DATABAR_L...

Страница 75: ...page mode CMP_PM_PRINT_SAVE int 2 Print and save canvas CMP_PM_NORMAL int 3 Print and exit page mode CMP_PM_CANCEL int 4 Cancel page mode 21 Page mode direction CMP_PD_LEFT_TO_RIGHT int 1 Normal prin...

Страница 76: ..._SUCCESS result Set encoding display SetEncoding Shift_JIS Clear text await display ClearDisplayAsync Display text await display DisplayTextAsync 123456 Set cursor position await display SetCursorPoso...

Страница 77: ...method is used to set the cursor position 9 Move cursor MoveCursorAsync method This method is used to move the cursor 10 Show cursor position SetCursorTypeAsync method This displays the current cursor...

Страница 78: ...onnected CDP_E_DISCONNECT 1002 The device is not connected CDP_E_NOTCONNECT 1003 Failed connection to the device CDP_E_CONNECT_NOTFOUND 1004 Failed to check the support model after connecting to the d...

Страница 79: ...rint SDK Programming Manual 3 3 2 Constructor Syntax LineDisplay Parameter Not exist Description It is the constructor for the library Create an instance Return value Not exist Example LineDisplay dis...

Страница 80: ...connected Connection port number is valid only if you specify the connection type CDP_PORT_WiFi If it is omitted it connects with number 9200 Timeout is giving the maximum number of milliseconds to co...

Страница 81: ...n This method is used to disconnect the line display connection When the end of the line display or some kind of errors occurs please disconnect the connection by the execution of this method Return v...

Страница 82: ...le range Data Text data String ReverseFlag Reverse specification flag false Standard true Reverse When the argument is omitted it is treated as false Description This method is used to display text fr...

Страница 83: ...lows Value Meaning Settable range displayArea Clear area CDP_AREA_ALL 0 Entire area CDP_AREA_CURSORLINE 1 Cursor line When the argument is omitted it is treated as CDP_AREA_ALL Description This method...

Страница 84: ...ue Meaning Settable range IntervalBlink Blink interval msec From 0 Description This method causes the entire display screen to blink The blink interval msec specifies the interval for on and off If 0...

Страница 85: ...e for input when it is at the bottom right edge VerticalScroll Scrolls the display line of the top edge to the bottom edge by cursor up movement when the cursor is at the top edge or by left movement...

Страница 86: ...Brightness 0 to 100 Description This method changes the brightness of the display screen The higher the numerical value the brighter the brightness becomes If 0 is specified the screen turns off the...

Страница 87: ...ws Value Meaning Settable range x Digit position From 1 y Line position From 1 Description This method is used to set the cursor position The cursor position is the movement coordinates of the cursor...

Страница 88: ...amount 128 to 127 dy Upward downward movement amount 128 to 127 Description This method is used to move the cursor Movement is from the current cursor position Specify the leftward rightward movement...

Страница 89: ...eaning Settable range CursorType Cursor type specification CDP_TYPE_NONE Hide cursor CDP_TYPE_UNDERLINE Display cursor Omittable element TYPE_UNDERLINE when omit Description This displays the current...

Страница 90: ...eDisplayAsync method Syntax Task int InitializeDisplayAsync Parameter None Description Initializes the device Return value Return CDP_SUCCESS 0 in success Please refer to 3 3 1 Return value for the er...

Страница 91: ...ers are as follows Element Meaning Settable range data Send data Description This method is used to transmit byte data as it is to the device Be careful not to affect other methods when using it Retur...

Страница 92: ...ed to set the encoding of the send data to the display When you create an instance it is initialized to the default character set of the OS When used in Japanese it is necessary to specify the Shift J...

Страница 93: ...ues of the parameters are as follows Element Meaning Settable range codePage Code page specification 0 255 Description Please refer to the command reference ESC t command of the utilization device for...

Страница 94: ...escription Set the following international character set characterset InternationalCharacterset characterset InternationalCharacterset 0 America 9 Norway 1 France 10 Denmark II 2 Germany 11 Spain II 3...

Страница 95: ...connected When the execution result of this method fails communication error or device error may have occurred In this case reconnect using DisconnectAsync method and ConnectAsync method In the case o...

Страница 96: ...ethod Syntax int GetVersionCode Parameter Not exist Description This method is used to get a numerical value for the version number of this SDK Return value Return a numerical value for the version nu...

Страница 97: ...ame method Syntax String GetVersionName Parameter Not exist Description This method is used to get a string for the version number of this SDK Return value Return a string for the version number of th...

Страница 98: ...rameters Parameter IN OUT Description Setting range mode IN Logging mode 0 None 1 Access logs 2 Error logs path IN File path to store maxSize IN Maximum Log Size 0 Unlimited 1 Maximum size MB Descript...

Страница 99: ...er When this setting is not specified log files will be stored into the local folder LogMaxSize Specifies maximum size of a log file in MB If 0 is specified log data will be written without limit Log...

Страница 100: ...ice 3 4 2 List of Constants Predefined No Type Name Data type Value Description 1 Result Error CDP_SUCCESS int 0 Successfully completed CDP_E_CONNECTED int 1001 Already connected CDP_E_DISCONNECT int...

Страница 101: ...us update call back status Start scan void StartScan Add event handler scanner DataEvent new DataEventHandler OnDataEvent scanner StatusUpdateEvent new StatusUpdateEventHandler OnStatusUpdateEvent Con...

Страница 102: ...scanner connection 3 Get version code getVersionCode method This method gets a numerical value for the version number of this SDK 4 Get version name getVersionName method This method gets a string fo...

Страница 103: ...CT 1002 The device is not connected CSC_E_NOTCONNECT 1003 Failed connection to the device CSC_E_CONNECT_NOTFOUND 1004 Failed to check the support model after connecting to the device CSC_E_CONNECT_OFF...

Страница 104: ...POS Print SDK Programming Manual 4 3 2 Constructor Syntax Scanner Parameter Not exist Description It is the constructor for the library Create an instance Return value Not exist Example Scanner scann...

Страница 105: ...the barcode scanner is connected Connection port number is valid only if you specify the connection type CSC_PORT_WiFi If it is omitted you connected with number 9210 Timeout is gives the maximum num...

Страница 106: ...ption This method is used to disconnect the barcode scanner connection When the end of the scanner or some kind of errors occurs please disconnect the connection by the execution of this method Return...

Страница 107: ...ethod Syntax int getVersionCode Parameter Not exist Description This method is used to get a numerical value for the version number of this SDK Return value Return a numerical value for the version nu...

Страница 108: ...ame method Syntax String getVersionName Parameter Not exist Description This method is used to get a string for the version number of this SDK Return value Return a string for the version number of th...

Страница 109: ...rameters Parameter IN OUT Description Setting range mode IN Logging mode 0 None 1 Access logs 2 Error logs path IN File path to store maxSize IN Maximum Log Size 0 Unlimited 1 Maximum size MB Descript...

Страница 110: ...aning Setting range data IN Scan data Description This event notifies data entry from the barcode scanner The event handler receives byte array type arguments as information read by the barcode scanne...

Страница 111: ...E 2001 Device is ready CSC_SUE_POWER_OFF 2002 Connection fault or not connected to the printer Description This event notifies update status of the device The event handler receives an int type argume...

Страница 112: ...l folder When this setting is not specified log files will be stored into the local folder LogMaxSize Specifies maximum size of a log file in MB If 0 is specified log data will be written without limi...

Страница 113: ...s not enough space to store log data in the device 4 4 2 List of Constants Predefined No Type Name Data type Value Description 1 Result Error CSC_SUCCESS int 0 Successfully completed CSC_E_CONNECTED i...

Страница 114: ...114 CITIZEN UWP POS Print SDK Programming Manual CITIZEN UWP POS Print SDK Programming Manual July 28 2021 For Ver 2 00 CITIZEN SYSTEMS JAPAN CO LTD http www citizen systems co jp...

Отзывы: