CITIZEN Android Label Print SDK
—
Programming Manual
21
}
// WaitingForPeeling Property
if ( printer.getWaitingForPeeling() == 1 ) {
// Waitiong for peeling
} else {
// Fail
Page 1: ...Android Label Print SDK Programming Manual Version 1 04...
Page 2: ...port model Sep 13 2018 1 02 Added Bluetooth as a interface of CL E720 730 model Modified the printer model name Added a locale for Chinese model and Korean model to drawTextPtrFont Added the Chinese m...
Page 3: ...l not be liable for any effect resulting 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 SDK Trademark Android is registered...
Page 4: ...property 30 2 2 14 VerticalMagnification property 31 2 2 15 FormatAttribute property 32 2 2 16 ContinuousMediaLength property 33 2 2 17 MeasurementUnit property 34 2 2 18 PrintSpeed property 35 2 2 1...
Page 5: ...71 2 3 9 drawPDF417 method 72 2 3 10 drawDataMatrix method 73 2 3 11 drawQRCode method 74 2 3 12 drawAztec method 75 2 3 13 drawGS1DataBar method 76 2 3 14 drawLine method 78 2 3 15 drawRect method 7...
Page 6: ...Bluetooth Android 3 1 API Level 12 or newer Wi Fi Bluetooth USB Host Supported printer models Object Model Interface Print Method CL S700 703 Wired Wireless LAN USB Direct thermal Thermal transfer CL...
Page 7: ...l 7 CL E300EX 303EX Wired Wireless LAN USB Bluetooth Direct thermal CL E321 331 Wired LAN USB Direct thermal Thermal tranfer CL E321EX 331EX Wired Wireless LAN USB Bluetooth Direct thermal Thermal tra...
Page 8: ...nual 8 1 3 Adding library to your net project Adding Library Place the library file in the project app libs folder as below Start up the AndroidStudio Right click the CSJLabelLib_Android jar of libs i...
Page 9: ...laration of Import Add the library file that is provided if you use this SDK please import the following three classes import com citizen sdk labelprint LabelConst import com citizen sdk labelprint La...
Page 10: ...CLS_BCS_CODE128 LabelConst CLS_RT_NORMAL 3 3 30 20 70 LabelConst CLS_BCS_TEXT_SHOW Create an instance LabelPrinter class LabelPrinter printer new LabelPrinter Connect printer int result printer connec...
Page 11: ...CITIZEN Android Label Print SDK Programming Manual 11 Printing result...
Page 12: ...usMediaLength R W Label length for continuous paper 5 MeasurementUnit R W Measurement unit Inches or millimeters 6 PrintSpeed R W Print speed 7 FeedSpeed R W Feed speed 8 SlewSpeed R W Slew speed 9 Ba...
Page 13: ...the flash memory of the printer 6 drawBitmap Draws a bitmap file in the computer 7 drawBarCode Draws a barcode 8 drawMaxiCode 9 drawPDF417 10 drawDataMatrix 11 drawQRCode 12 drawAztec 13 drawGS1DataB...
Page 14: ...ONTEXT 1006 No context is specified CLS_E_BT_DISABLE 1007 The Bluetooth device setting is invalid CLS_E_BT_NODEVICE 1008 The Bluetooth device is not found CLS_E_ILLEGAL 1101 The operation is not suppo...
Page 15: ...t SDK Programming Manual 15 2 2 LabelPrinter class 2 2 1 Constructor Syntax LabelPrinter Parameters none Description Creates an instance of the LabelPrinter class Return value none Example LabelPrinte...
Page 16: ...SB connection and the search printer Specify the context Must be executed this method before the connect method on the USB connection and the searchLabelPrinter method If you want to connect with othe...
Page 17: ...t be written in upper case When the Bluetooth device name is specified it looks for a paired device which matches up When the Bluetooth device name is not specified it looks for a paired supported dev...
Page 18: ...connected 2 The printer is not turned on 3 The port handle could not be obtained CLS_E_CONNECT_NOTFOUND 1004 Failed to confirm if the printer is a supported model 1 The printer model is not supported...
Page 19: ...int disconnect Parameters none Description Disconnects a printer This must be called when a connection is no longer needed or when an error occurs Return value Returns CLS_SUCCESS 0 on success an erro...
Page 20: ...connection by calling it periodically In case of network connection with the CL S5xx 6xx 70x set Parallel Error Output to OFF beforehand In case of parallel connection with all models set Parallel Err...
Page 21: ...CITIZEN Android Label Print SDK Programming Manual 21 WaitingForPeeling Property if printer getWaitingForPeeling 1 Waitiong for peeling else Fail...
Page 22: ...LabelDesignclass quantity IN Number of labels to print 1 9999 Description Prints labels by sending a label design created in the LabelDesign class followed by printer configuration commands if any of...
Page 23: ...ation width and height The stored bitmap image can be used by the drawNVBitmap method Supported graphic file formats are BMP GIF EXIF JPG PNG TIFF The image is resized by the specified width and heigh...
Page 24: ...Syntax int clearOutput Parameters none Description Clears data in the print buffer This triggers the initialization process which is equivalent to the boot sequence Return value Returns CLS_SUCCESS 0...
Page 25: ...ter IN OUT Description Setting range data IN Send data Description Sends binary data to a printer This can be used only when sending raw printer commands to the printer Return value Returns CLS_SUCCES...
Page 26: ...This method doesn t work on the simulator After the specified time of searching process it returns an array of printer information found receives a result code to the output parameter result In case o...
Page 27: ...ress Bluetooth device address Example int errCode new int 1 CitizenPrinterInfo list printer searchCitizenPrinter LabelConst CLS_PORT_WiFi 3 errCode for int i 0 i list length i Log e Search IP Address...
Page 28: ...ains a list of printer addresses The connection type and time out value must be specified setContext must be called prior to searchLabelPrinter This method doesn t work on the simulator After the spec...
Page 29: ...eter IN OUT Description Setting range mode IN Logging mode 0 None 1 Access logs 2 Error logs path IN File path to store The folder of SD card maxSize IN Maximum Log Size 0 Unlimited 1 Maximum size MB...
Page 30: ...on Horizontal dot size 1 or 2 Setter method int setHorizontalMagnification int horizontalMagnification 1 or 2 must be set as a parameter Returns CLS_SUCCESS 0 on success See 2 1 Return value for the e...
Page 31: ...tion Vertical dot size 1 2 or 3 Setter method int setVerticalMagnification int verticalMagnification 1 2 or 3 must be set as a parameter Returns CLS_SUCCESS 0 on success See 2 1 Return value for the e...
Page 32: ...erlapped area will not be printed 1 OR mode Overlapped area will be printed Setter method int setFormatAttribute int formatAttribute Returns CLS_SUCCESS 0 on success See 2 1 Return value for the error...
Page 33: ...ystem 0001 9999 0 1 999 9 mm Setter method int setContinuousMediaLength int continuousMediaLength The default value in the printer is 0000 Returns CLS_SUCCESS 0 on success See 2 1 Return value for the...
Page 34: ...CLS_UNIT_INCH 1 Inch system Setter method int setMeasurementUnit int measurementUnit The default value in the printer is 1 Returns CLS_SUCCESS 0 on success See 2 1 Return value for the error codes Get...
Page 35: ...e Initial and maximum value vary depending on the printer model Setter method int setPrintSpeed int printSpeed Returns CLS_SUCCESS 0 on success See 2 1 Return value for the error codes Getter method i...
Page 36: ...lue Initial and maximum value vary depending on the printer model Setter method int setFeedSpeed int feedSpeed Returns CLS_SUCCESS 0 on success See 2 1 Return value for the error codes Getter method i...
Page 37: ...lue Initial and maximum value vary depending on the printer model Setter method int setSlewSpeed int slewSpeed Returns CLS_SUCCESS 0 on success See 2 1 Return value for the error codes Getter method i...
Page 38: ...DSETTING_J 5 0 inch 127 0mm sec CLS_SPEEDSETTING_K or CLS_SPEEDSETTING_L 6 0 inch 152 4mm sec CLS_SPEEDSETTING_M or CLS_SPEEDSETTING_N 7 0 inch 177 8mm sec CLS_SPEEDSETTING_O 8 0 inch 203 2mm sec CLS_...
Page 39: ...are below Setting range 0 30 Default value 10 Setter method int setPrintDarkness int printDarkness Returns CLS_SUCCESS 0 on success See 2 1 Return value for the error codes Getter method int getPrint...
Page 40: ...e acceptable values are below 0 OFF Default 1 ON Setter method int setDoubleHeat int doubleHeat Returns CLS_SUCCESS 0 on success See 2 1 Return value for the error codes Getter method int getDoubleHea...
Page 41: ...00 9999 0 00 inch 99 99 inches Metric system 0000 9999 0 0 mm 999 9 mm Default value 0000 Setter method int setVerticalOffset int verticalOffset Returns CLS_SUCCESS 0 on success See 2 1 Return value f...
Page 42: ...9999 0 00 inch 99 99 inches Metric system 0000 9999 0 0 mm 999 9 mm Default value 0000 Setter method int setHorizontalOffset int horizontalOffset Returns CLS_SUCCESS 0 on success See 2 1 Return value...
Page 43: ...3 To pause after printing CLS_MEDIAHANDLING_CUT 4 To cut after printing CLS_MEDIAHANDLING_CUTANDPAUSE 5 To cut and pause after printing CLS_MEDIAHANDLING_PEELOFF 6 To peel labels off the backing and...
Page 44: ...Minimum value Max value 0220 0120 0320 0559 0305 0813 0 01 inches or 0 1 mm Setter method int setStartOffset int startOffset Make sure to set a valid value since the consistency with the selected meas...
Page 45: ...value truncates the next label Media handling Inch system Metric system Initial value Minimum value Max value Initial value Minimum value Max value None 0000 0000 9999 0000 0000 9999 Cutter 0100 0254...
Page 46: ...ch on tags CLS_SELSENSOR_REFLECT 2 Reflect sensor Detect a black mark on the back side of the label Setter method int setLabelSensor int labelSensor Returns CLS_SUCCESS 0 on success See 2 1 Return val...
Page 47: ...CLS_PRTMETHOD_TT 0 Thermal transfer CLS_PRTMETHOD_DT 1 Direct thermal Setter method int setPrintMethod int printMethod Returns CLS_SUCCESS 0 on success See 2 1 Return value for the error codes Getter...
Page 48: ...l be kept until overwritten Value Description CLS_SENS_LOCATION_FRONT 0 Front sensor CLS_SENS_LOCATION_ADJUSTABLE 1 Rear sensor Setter method int setSensorLocation int sensorLocation Returns CLS_SUCCE...
Page 49: ...s processing commands Note that the status properties won t be updated automatically printerCheck method checks the status and updates the value must be called before referring to this property Setter...
Page 50: ...error Note that the status properties won t be updated automatically printerCheck method checks the status and updates the value must be called before referring to this property Setter method none Get...
Page 51: ...d error Note that the status properties won t be updated automatically printerCheck method checks the status and updates the value must be called before referring to this property Setter method none G...
Page 52: ...tch print jobs Note that the status properties won t be updated automatically printerCheck method checks the status and updates the value must be called before referring to this property Setter method...
Page 53: ...inting Note that the status properties won t be updated automatically printerCheck method checks the status and updates the value must be called before referring to this property Setter method none Ge...
Page 54: ...mode Note that the status properties won t be updated automatically printerCheck method checks the status and updates the value must be called before referring to this property Setter method none Gett...
Page 55: ...r peeling status Note that the status properties won t be updated automatically printerCheck method checks the status and updates the value must be called before referring to this property Setter meth...
Page 56: ...rint SDK Programming Manual 56 2 3 LabelDesign class 2 3 1 Constructor Syntax LabelDesign Parameters none Description Creates an instance of the LabelDesign class Return value none Example LabelDesign...
Page 57: ...t CLS_PRT_FNT_TRIUMVIRATE_B Smooth font bold CLS_PRT_FNT_KANJI Kanji left to right CLS_PRT_FNT_KANJIT Kanji top to bottom rotation IN Direction of rotation CLS_RT_NORMAL No rotation CLS_RT_RIGHT90 Rot...
Page 58: ...OTHER design drawTextPtrFont drawTextPtrFont LabelConst CLS_LOCALE_OTHER LabelConst CLS_PRT_FNT_TRIUMVIRATE LabelConst CLS_RT_NORMAL 1 1 LabelConst CLS_PRT_FNT_SIZE_10 100 100 Locale JP design drawTe...
Page 59: ...ter Numeric characters Bitmap font Alphanumeric characters TrueType font rotation IN Direction of rotation CLS_RT_NORMAL No rotation CLS_RT_RIGHT90 Rotate CW 90 CLS_RT_ROTATE180 Rotate CW 180 CLS_RT_L...
Page 60: ...rror code otherwise See 2 1 Return value for the error codes Example TrueType font design drawTextDLFont TrueType LabelConst CLS_ENC_CDPG_IBM850 S50 LabelConst CLS_RT_NORMAL 1 1 12 100 100 Bitmap font...
Page 61: ...CLS_FNT_UNDERLINE Underline CLS_FNT_ITALIC Italic CLS_FNT_STRIKEOUT Strikethrough Use to specify multiple options x IN X coordinate 0000 9999 The origin is at bottom left 0 0 y IN Y coordinate resolut...
Page 62: ..._BOLD LabelConst CLS_FNT_ITALIC 10 0 300 dpi inch default design drawTextLocalFont drawTextLocalFont Typeface SERIF LabelConst CLS_RT_NORMAL 100 100 10 LabelConst CLS_FNT_DEFAULT 10 50 LabelConst CLS_...
Page 63: ...llowing symbols hexp IN Horizontal magnification 1 24 vexp IN Vertical magnification 1 24 x IN X coordinate 0000 9999 The origin is at bottom left 0 0 y IN Y coordinate Description Draws a graphic by...
Page 64: ...specifying options such as rotation size and coordinates What this method does internally is to store a graphic image into the printer and to print the stored graphic image This doesn t check the avai...
Page 65: ...i default inch default design drawBitmap sdcard temp citizen Images Sample bmp LabelConst CLS_RT_NORMAL 0 0 10 10 300 dpi mm design drawBitmap sdcard temp citizen Images Sample bmp LabelConst CLS_RT_N...
Page 66: ...Plessey CLS_BCS_CASECODE CASE CODE CLS_BCS_UPC2DIG UPC 2DIG ADD CLS_BCS_UPC5DIG UPC 5DIG ADD CLS_BCS_CODE93 Code93 CLS_BCS_ITF14 ITF 14 CLS_BCS_ZIP ZIP CLS_BCS_ITF16 IFT 16 CLS_BCS_UCCEAN128 UCC EAN...
Page 67: ...Const CLS_BCS_UPCA LabelConst CLS_RT_NORMAL 2 2 50 10 100 LabelConst CLS_BCS_TEXT_SHOW UPC E String upce 123456 design drawBarCode upce LabelConst CLS_BCS_UPCE LabelConst CLS_RT_NORMAL 2 2 50 10 100 L...
Page 68: ...nst CLS_RT_NORMAL 4 2 50 10 10 LabelConst CLS_BCS_TEXT_SHOW CASE CODE String casecode 1234567890123 design drawBarCode casecode LabelConst CLS_BCS_CASECODE LabelConst CLS_RT_NORMAL 5 2 50 10 100 Label...
Page 69: ...LabelConst CLS_RT_NORMAL 5 2 50 10 100 LabelConst CLS_BCS_TEXT_SHOW UCC EAN 128 String uccean128 1234567890123456789 design drawBarCode uccean128 LabelConst CLS_BCS_UCCEAN128 LabelConst CLS_RT_NORMAL...
Page 70: ...6789012345678909999 design drawBarCode uccean128randomweight LabelConst CLS_BCS_UCCEAN128RANDOMWEIGHT LabelConst CLS_RT_NORMAL 2 2 50 10 10 LabelConst CLS_BCS_TEXT_SHOW Telepen String telepen 12345678...
Page 71: ...oordinate 0000 9999 The origin is at bottom left 0 0 y IN Y coordinate Description Draws the UPS MaxiCode barcode with specifying options such as rotation and coordinates The following information are...
Page 72: ...correction level CLS_PDF417_EC_LEVEL_0 Level 0 CLS_PDF417_EC_LEVEL_1 Level 1 CLS_PDF417_EC_LEVEL_2 Level 2 CLS_PDF417_EC_LEVEL_3 Level 3 CLS_PDF417_EC_LEVEL_4 Level 4 CLS_PDF417_EC_LEVEL_5 Level 5 CLS...
Page 73: ...RT_NORMAL No rotation CLS_RT_RIGHT90 Rotate CW 90 CLS_RT_ROTATE180 Rotate CW 180 CLS_RT_LEFT90 Rotate CCW 90 exp IN Magnification 1 15 ECLevel IN Error correction level CLS_DATAMATRIX_EC_LEVEL_200 200...
Page 74: ...90 exp IN Magnification 1 15 ECLevel IN Error correction level CLS_QRCODE_EC_LEVEL_L Level L 7 CLS_QRCODE_EC_LEVEL_M Level M 15 CLS_QRCODE_EC_LEVEL_Q Level Q 25 CLS_QRCODE_EC_LEVEL_H Level H 30 x IN...
Page 75: ...CW 90 CLS_RT_ROTATE180 Rotate CW 180 CLS_RT_LEFT90 Rotate CCW 90 exp IN Magnification 1 15 ECLevel IN Error correction level CLS_AXTEC_EC_LEVEL_000 Level 0 Error correction ratio 23 x IN X coordinate...
Page 76: ...TATE180 Rotate CW 180 CLS_RT_LEFT90 Rotate CCW 90 exp IN Magnification 1 15 x IN X coordinate 0000 9999 The origin is at bottom left 0 0 y IN Y coordinate Description Draws the GS1DataBar barcode with...
Page 77: ...belConst CLS_RT_NORMAL 3 10 310 GS1 DataBar Stacked Omni Directional String stackedOD new String 1234567890123 design drawGS1DataBar stackedOD LabelConst CLS_GS1_DATABAR_STACKED_OMNI_DIRECTIONAL Label...
Page 78: ...e point is center 0000 9999 Description Draws a line of the specified width Start and stop positions will be located at the center of the line Each coordinate must be within the range of 0000 9999 Mor...
Page 79: ...origin is at bottom left 0 0 y IN Start position Y coordinate width IN Box width 0000 9999 height IN Box height thickness IN Line width 0000 9999 Description Draws a box of the specified width height...
Page 80: ...Shaded pattern 001 CLS_SHADED_PTN_2 Shaded pattern 002 CLS_SHADED_PTN_3 Shaded pattern 003 CLS_SHADED_PTN_4 Shaded pattern 004 CLS_SHADED_PTN_5 Shaded pattern 005 CLS_SHADED_PTN_6 Shaded pattern 006...
Page 81: ...n Setting range x IN Start position X coordinate center 0000 9999 The origin is at bottom left 0 0 y IN Start position Y coordinate center radius IN Radius 0000 0398 Description Draws a circle of the...
Page 82: ...ed pattern 001 CLS_SHADED_PTN_2 Shaded pattern 002 CLS_SHADED_PTN_3 Shaded pattern 003 CLS_SHADED_PTN_4 Shaded pattern 004 CLS_SHADED_PTN_5 Shaded pattern 005 CLS_SHADED_PTN_6 Shaded pattern 006 CLS_S...
Page 83: ...IN Y points Description Draws a closed polygon defined by arrays of x and y coordinates Each pair of x y coordinates defines a point The number of elements must match Returns CLS_E_ILLEGAL 1101 other...
Page 84: ...CLS_SHADED_PTN_6 Shaded pattern 006 CLS_SHADED_PTN_7 Shaded pattern 007 CLS_SHADED_PTN_8 Shaded pattern 008 CLS_SHADED_PTN_9 Shaded pattern 009 CLS_SHADED_PTN_10 Shaded pattern 010 CLS_SHADED_PTN_11 S...
Page 85: ...ally The SendData method in the LabelPrinter class requires complete label commands both system level commands and label format commands Return value Returns CLS_SUCCESS 0 on success an error code oth...
Page 86: ...ent unit Example Polygon int x new int 50 75 100 int y new int 50 125 50 design drawPolygon x y Rect design drawRect 50 200 50 50 1 Circle design drawCircle 250 50 30 Text design drawTextLocalFont ABC...
Page 87: ...th a file name CSJLabelLib_ and a number which indicates the day of week 0 to 6 0 Sunday 1 Monday and a file extension log Example CSJLabelLib_1 log When the same file name exists the file will be ove...
Page 88: ...since it tries to keep the information of every single execution of a method or access to a property Logging could fail without a notification for the reason below A write protected device is selected...
Page 89: ...S 4 Connection interface CLS_PORT_WiFi int 0 Network CLS_PORT_Bluetooth int 1 Bluetooth CLS_PORT_Bluetooth_Insecure int 2 Bluetooth Insecure CLS_PORT_USB int 3 USB 5 Serial communication condition CLS...
Page 90: ...BM437 int 437 IBM437 OEM USA CLS_ENC_CDPG_IBM500 int 500 IBM500 IBM EBCDIC International CLS_ENC_CDPG_IBM737 int 737 ibm737 Greek DOS CLS_ENC_CDPG_IBM775 int 775 ibm775 Baltic DOS CLS_ENC_CDPG_IBM850...
Page 91: ...int 10029 x mac ce Central Europe Mac CLS_ENC_CDPG_X_MAC_ICELANDIC int 10079 x mac icelandic Icelandic Mac CLS_ENC_CDPG_X_MAC_TURKISH int 10081 x mac turkish Turkish Mac CLS_ENC_CDPG_X_MAC_CROATIAN i...
Page 92: ...tate 90 CW CLS_RT_ROTATE180 int 3 Rotate 180 CLS_RT_LEFT90 int 4 Rotate 90 CCW 12 Barcode symbology CLS_BCS_CODE39 int 100 Code 3 of 9 CLS_BCS_UPCA int 101 UPC A CLS_BCS_UPCE int 102 UPC E CLS_BCS_INT...
Page 93: ...int 0 GS1DataBar Omni dirctional CLS_GS1_DATABAR_COMPOSITE int 1 GS1DataBar Conposite CLS_GS1_DATABAR_TRUNCATION int 2 GS1DataBar Truncation CLS_GS1_DATABAR_STACKED int 3 GS1DataBar Stacked CLS_GS1_DA...
Page 94: ...int 24 O 8 0inch 203 2mm sec CLS_SPEEDSETTING_P int 25 P 8 0inch 203 2mm sec CLS_SPEEDSETTING_Q int 26 Q 9 0inch 228 6mm sec CLS_SPEEDSETTING_R int 27 R 9 0inch 228 6mm sec CLS_SPEEDSETTING_S int 28 S...
Page 95: ...CITIZEN Android Label Print SDK Programming Manual 95 CITIZEN Android Label Print SDK Programming Manual June 2 2020 Version 1 04 CITIZEN SYSTEMS JAPAN CO LTD http www citizen systems co jp...