Citizen CL-S700 Programming Manual

Citizen CL-S700 Programming Manual

Android label print sdk
Hide thumbs Also See for CL-S700:
Table of Contents

Advertisement

Android Label Print SDK
Programming Manual
Version 1.04

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CL-S700 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Citizen CL-S700

  • Page 1 Android Label Print SDK Programming Manual Version 1.04...
  • Page 2 CITIZEN Android Label Print SDK — Programming Manual Revision History Date Version Description Sep 28, 2016 1.00 First issue. - Renamed the namespace to “com.citizen.sdk.labelprint”. - Added an explanation of ParallelErrorOutput to printerCheck method. Mar 15, 2017 - Added the measurementUnit as a parameter of drawTextLocalFont method.
  • Page 3 Java is a registered trademark of Oracle in the United States and/or other countries. Company names and product names appearing on this document are trademarks and/or registered trademarks of respective companies. CITIZEN is a registered trademark of Citizen Watch Co., Ltd.
  • Page 4: Table Of Contents

    CITIZEN Android Label Print SDK — Programming Manual Table of Contents 1. Introduction ..............................6 1.1. Who should read this document ......................... 6 1.2. System summary ............................6 1.3. Adding library to your .net project ......................8 1.4. Program structure ............................ 10 1.5.
  • Page 5 CITIZEN Android Label Print SDK — Programming Manual 2.3.1 Constructor ............................56 2.3.2 drawTextPtrFont method ........................57 2.3.3 drawTextDLFont method ........................59 2.3.4 drawTextLocalFont method ....................... 61 2.3.5 drawNVBitmap method ........................63 2.3.6 drawBitmap method ........................... 64 2.3.7 drawBarCode method ......................... 66 2.3.8 drawMaxiCode method ........................
  • Page 6: Introduction

    1. Introduction This document is a programming manual for the CITIZEN Android Label Print SDK. 1.1. Who should read this document This document is intended for developers who integrate their Android application programs with Citizen label printers. 1.2. System summary This SDK is referred by Android application program to control Citizen Label printers.
  • Page 7 CITIZEN Android Label Print SDK — Programming Manual 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 tranfer Refer to each user’s manual for more details.
  • Page 8: Adding Library To Your .Net Project

    CITIZEN Android Label Print SDK — Programming Manual 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 in the folder, please select...
  • Page 9 CITIZEN Android Label Print SDK — Programming Manual Declaration 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.LabelPrinter; import com.citizen.sdk.labelprint.LabelDesign;...
  • Page 10: Program Structure

    CITIZEN Android Label Print SDK — Programming Manual 1.4. Program structure Here is an example program in Java which uses the SDK. // Create an instance( LabelDesign class ) LabelDesign design = new LabelDesign(); // Text design.drawTextPtrFont("Sample Print", LabelConst.CLS_LOCALE_JP, LabelConst.CLS_PRT_FNT_TRIUMVIRATE_B, LabelConst.CLS_RT_NORMAL, 1, 1, LabelConst.CLS_PRT_FNT_SIZE_24, 20,...
  • Page 11 CITIZEN Android Label Print SDK — Programming Manual Printing result...
  • Page 12: Class Summary

    CITIZEN Android Label Print SDK — Programming Manual 1.5. Class summary Methods (LabelPrinter class) Method Description LabelPrinter Constructor. setContext Set the context. connect Connects to a printer. disconnect Disconnects with a printer. printerCheck Gets status of a printer. print Prints labels.
  • Page 13 CITIZEN Android Label Print SDK — Programming Manual Methods (LabelDesign class) Method Description Constructor. LabelDesign Draws text by using a printer device font. drawTextPtrFont Draws text by using a downloaded font. drawTextDLFont Draws text by using a font installed in the terminal.
  • Page 14: Api Specification

    CITIZEN Android Label Print SDK — Programming Manual 2. API specification 2.1. Return value Return value Description CLS_SUCCESS (0) The operation has been done successfully. CLS_E_CONNECTED (1001) The printer is already connected. CLS_E_DISCONNECT (1002) The printer is not connected. CLS_E_NOTCONNECT (1003) Failed to connect to the printer.
  • Page 15: Labelprinter Class

    CITIZEN Android Label Print SDK — Programming Manual 2.2. LabelPrinter class 2.2.1 Constructor Syntax LabelPrinter () Parameters none Description Creates an instance of the LabelPrinter class. Return value none Example LabelPrinter printer = new LabelPrinter();...
  • Page 16: Setcontext Method

    CITIZEN Android Label Print SDK — Programming Manual 2.2.2 setContext method Syntax int setContext( Context context ) Parameters [IN/OUT] 意味 値 設定可能範囲 context [IN] Context Context : (android.content.Context) Description This method is used to the USB connection and the search printer. Specify the context.
  • Page 17: Connect Method

    CITIZEN Android Label Print SDK — Programming Manual 2.2.3 connect method Syntax 1) int connect (int connectType, String address) 2) int connect (int connectType, String address, int port) 3) int connect (int connectType, String address, int port, int timeout) 4) int connect (int connectType, UsbDevice device)
  • Page 18 CITIZEN Android Label Print SDK — Programming Manual Return value Returns CLS_SUCCESS (0) on success, an error code otherwise. See below for the error codes. "2.1 Return value" describes all error codes. Error code Description CLS_E_CONNECTED (1001) The printer is already connected.
  • Page 19: Disconnect Method

    CITIZEN Android Label Print SDK — Programming Manual 2.2.4 disconnect method Syntax 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 error code otherwise. See "2.1 Return...
  • Page 20: Printercheck Method

    CITIZEN Android Label Print SDK — Programming Manual 2.2.5 printerCheck method Syntax int printerCheck () Parameters none Description Gets the status of the printer and stores information into the properties, CommandInterpreterInAction, PaperError, RibbonEnd, BatchProcessing, Printing, Pause and WaitingForPeeling. When this method returns an error, a communication failure or a device error might occur. The...
  • Page 21 CITIZEN Android Label Print SDK — Programming Manual // WaitingForPeeling Property if ( printer.getWaitingForPeeling() == 1 ) { // Waitiong for peeling else // Fail...
  • Page 22: Print Method

    CITIZEN Android Label Print SDK — Programming Manual 2.2.6 print method Syntax int print (LabelDesign design, int quantity) Parameters Parameter [IN/OUT] Description Setting range design [IN] Instance of 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 properties are set.
  • Page 23: Storenvbitmap Method

    CITIZEN Android Label Print SDK — Programming Manual 2.2.7 storeNVBitmap method Syntax int storeNVBitmap (String filePath, String name, int rotation, int width, int height) Parameters Parameter [IN/OUT] Description Setting range filePath [IN] Path to a bitmap file to store name...
  • Page 24: Clearoutput Method

    CITIZEN Android Label Print SDK — Programming Manual 2.2.8 clearOutPut method 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) on success. See "2.1 Return...
  • Page 25: Senddata Method

    CITIZEN Android Label Print SDK — Programming Manual 2.2.9 sendData method Syntax int sendData (byte[] data) Parameters Parameter [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.
  • Page 26: Searchcitizenprinter Method

    (2) The time out value is out of range. CLS_E_NO_LIST (1106) No printer found. Description Searches available Citizen printers and obtains a list of printer information. The connection type and time out value must be specified. setContext() must be called prior to searchCitizenPrinter(). This method doesn't work on the simulator.
  • Page 27 CITIZEN Android Label Print SDK — Programming Manual bdAddress 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: " + list[i].ipAddress);...
  • Page 28: Searchlabelprinter Method

    (2) The time out value is out of range. CLS_E_NO_LIST (1106) No printer found. Description Searches available Citizen printers and obtains 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.
  • Page 29: Setlog Method

    CITIZEN Android Label Print SDK — Programming Manual 2.2.12 setLog method Syntax void setLog (int mode, String path, int maxSize) Parameters Parameter [IN/OUT] Description Setting range mode [IN] Logging mode 0: None 1: Access logs 2: Error logs path [IN]...
  • Page 30: Horizontalmagnification Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.13 HorizontalMagnification property Syntax int HorizontalMagnification Attribute Read/Write Description 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...
  • Page 31: Verticalmagnification Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.14 VerticalMagnification property Syntax int VerticalMagnification Attribute Read/Write Description Vertical dot size. "1", "2" or "3". Setter method int setVerticalMagnification (int verticalMagnification) "1", "2" or "3" must be set as a parameter.
  • Page 32: Formatattribute Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.15 FormatAttribute property Syntax int FormatAttribute Attribute Read/Write Description Specifies how to print the area where multiple objects are overlapped. 0: XOR mode. Overlapped area will not be printed. 1: OR mode. Overlapped area will be printed.
  • Page 33: Continuousmedialength Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.16 ContinuousMediaLength property Syntax int ContinuousMediaLength Attribute Read/Write Description Sets a paper length for continuous paper. Inch system 0001 – 9999 (0.01 - 99.99 inches) Metric system 0001 – 9999 (0.1 - 999.9 mm)
  • Page 34: Measurementunit Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.17 MeasurementUnit property Syntax int MeasurementUnit Attribute Read/Write Description Sets the measurement unit. Value Description CLS_UNIT_MILLI (0) Metric system CLS_UNIT_INCH (1) Inch system Setter method int setMeasurementUnit (int measurementUnit) The default value in the printer is "1."...
  • Page 35: Printspeed Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.18 PrintSpeed property Syntax int PrintSpeed Attribute Read/Write Description Sets the print speed. "3.3.Predefined Constants", No.21 for available value. *Initial and maximum value vary depending on the printer model. Setter method int setPrintSpeed (int printSpeed) Returns CLS_SUCCESS (0) on success.
  • Page 36: Feedspeed Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.19 FeedSpeed property Syntax int FeedSpeed Attribute Read/Write Description Sets the feed speed. See "3.3.Predefined Constants", No.21 for available value. *Initial and maximum value vary depending on the printer model. Setter method int setFeedSpeed (int feedSpeed) Returns CLS_SUCCESS (0) on success.
  • Page 37: Slewspeed Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.20 SlewSpeed property Syntax int SlewSpeed Attribute Read/Write Description Sets the slew speed. See "3.3.Predefined Constants", No.21 for available value. *Initial and maximum value vary depending on the printer model. Setter method int setSlewSpeed (int slewSpeed) Returns CLS_SUCCESS (0) on success.
  • Page 38: Backupspeed Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.21 BackupSpeed property Syntax int BackupSpeed Attribute Read/Write Description Sets the backup speed. See below for the acceptable values. Value Description CLS_SPEEDSETTING_A or 1.0 inch( 25.4mm) / sec CLS_SPEEDSETTING_B CLS_SPEEDSETTING_C or 2.0 inch( 50.8mm) / sec...
  • Page 39: Printdarkness Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.22 PrintDarkness property Syntax int PrintDarkness Attribute Read/Write Description Sets the print density. The acceptable values are below: Setting range 0 - 30 Default value Setter method int setPrintDarkness (int printDarkness) Returns CLS_SUCCESS (0) on success. See "2.1 Return...
  • Page 40: Doubleheat Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.23 DoubleHeat property Syntax int DoubleHeat Attribute Read/Write Description Sets the double heat option. The 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...
  • Page 41: Verticaloffset Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.24 VerticalOffset property Syntax int VerticalOffset Attribute Read/Write Description Sets the vertical offset to adjust the vertical printing position on the paper. Inch system 0000 – 9999 (0.00 inch - 99.99 inches) Metric system 0000 –...
  • Page 42: Horizontaloffset Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.25 HorizontalOffset property Syntax int HorizontalOffset Attribute Read/Write Description Sets the horizontal offset to adjust the horizontal printing position on the paper. Inch system 0000 – 9999 (0.00 inch - 99.99 inches) Metric system 0000 –...
  • Page 43: Mediahandling Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.26 MediaHandling property Syntax int MediaHandling Attribute Read/Write Description Sets the way how to handle media after printing. Value Description CLS_MEDIAHANDLING_NONE (0) To print without any special actions. CLS_MEDIAHANDLING_TEAROFF (1) To feed labels to the tear bar.
  • Page 44: Startoffset Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.27 StartOffset property Syntax int StartOffset Attribute Read/Write Description Specifies the distance between paper sensor and print head to change the print starting position. Inch system Metric system Initial Minimum Initial Minimum...
  • Page 45: Stopoffset Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.28 StopOffset property Syntax int StopOffset Attribute Read/Write Description Specifies the distance between paper sensor and cutter or peeler to change the print stop position. Note that the initial values are calculated to stop paper at an appropriate position. An insufficient value truncates the printed label, an exceeded value truncates the next label.
  • Page 46: Labelsensor Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.29 LabelSensor property Syntax int LabelSensor Attribute Read/Write Description Sets the label sensor type. Value Description CLS_SELSENSOR_NONE (0) None. This assumes that a continuous paper roll is used. Therefore a valid length must be set in the...
  • Page 47: Printmethod Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.30 PrintMethod property Syntax int PrintMethod Attribute Read/Write Description Sets the print method to either thermal transfer or direct thermal. Value Description CLS_PRTMETHOD_TT (0) Thermal transfer CLS_PRTMETHOD_DT (1) Direct thermal Setter method int setPrintMethod (int printMethod) Returns CLS_SUCCESS (0) on success.
  • Page 48: Sensorlocation Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.31 SensorLocation property Syntax int SensorLocation Attribute Read/Write Description Selects the sensor to use for the models which have multiple paper sensors, front and rear. The choice will be stored in the non-volatile flash memory and will be kept until overwritten.
  • Page 49: Commandinterpreterinaction Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.32 CommandInterpreterInAction property Syntax int CommandInterpreterInAction Attribute Read Description Shows the printer status if the interpreter is 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.
  • Page 50: Papererror Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.33 PaperError property Syntax int PaperError Attribute Read Description Shows the printer status if there is a paper 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.
  • Page 51: Ribbonend Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.34 RibbonEnd property Syntax int RibbonEnd Attribute Read Description Shows the printer status if there is a ribbon end 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.
  • Page 52: Batchprocessing Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.35 BatchProcessing property Syntax int BatchProcessing Attribute Read Description Shows the status if the printer is processing batch 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.
  • Page 53: Printing Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.36 Printing property Syntax int Printing Attribute Read Description Shows the status if the printer is currently printing. 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.
  • Page 54: Pause Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.37 Pause property Syntax int Pause Attribute Read Description Shows the status if the printer is in the pause 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.
  • Page 55: Waitingforpeeling Property

    CITIZEN Android Label Print SDK — Programming Manual 2.2.38 WaitingForPeeling property Syntax int WaitingForPeeling Attribute Read Description Shows the status if the printer is in the wait for 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.
  • Page 56: Labeldesign Class

    CITIZEN Android Label Print SDK — Programming Manual 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 design = new LabelDesign();...
  • Page 57: Drawtextptrfont Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.2 drawTextPtrFont method Syntax int drawTextPtrFont (String data, int locale, int font, int rotation, int hexp, int vexp, int size, int x, int y) Parameters Parameter [IN/OUT] Description Setting range data [IN]...
  • Page 58 CITIZEN Android Label Print SDK — Programming Manual Description Draws characters by using a printer device font with specifying options such as rotation, magnification, size and coordinates. Available font sizes depend on typeface. Kanji: 16, 24, 32, 48 *dots Smooth font: 4, 5, 6, 8, 10, 12, 14, 18, 24, 30, 36, 48 Other: Fixed sizes depend on typeface.
  • Page 59: Drawtextdlfont Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.3 drawTextDLFont method Syntax int drawTextDLFont (String data, int encoding, String fontID, int rotation, int hexp, int vexp, int point, int x, int y) Parameters Parameter [IN/OUT] Description Setting range data [IN]...
  • Page 60 CITIZEN Android Label Print SDK — Programming Manual Return value Returns CLS_SUCCESS(0) on success, an error 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 design.drawTextDLFont("Bitmap",...
  • Page 61: Drawtextlocalfont Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.4 drawTextLocalFont method Syntax 1) int drawTextLocalFont (String data, Typeface fontType, int rotation, int hRatio, int vRatio, int point, int style, int x, int y) 2) int drawTextLocalFont (String data, Typeface fontType, int rotation, int hRatio, int vRatio,...
  • Page 62 CITIZEN Android Label Print SDK — Programming Manual Example // 203 dpi(default), inch(default) design.drawTextLocalFont("drawTextLocalFont", Typeface.SERIF, LabelConst.CLS_RT_NORMAL, 100, 100, 10, (LabelConst.CLS_FNT_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_PRT_RES_300); // 300 dpi, mm design.drawTextLocalFont("drawTextLocalFont", Typeface.SERIF,...
  • Page 63: Drawnvbitmap Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.5 drawNVBitmap method Syntax int drawNVBitmap (String name, int hexp, int vexp, int x, int y) Parameters Parameter [IN/OUT] Description Setting range name [IN] Graphic file name ASCII characters except below: -Underscore cannot be the first character.
  • Page 64: Drawbitmap Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.6 drawBitmap method Syntax 1) int drawBitmap (String filePath, int rotation, int width, int height, int x, int y) 2) int drawBitmap (String filePath, int rotation, int width, int height, int x, int y,...
  • Page 65 CITIZEN Android Label Print SDK — Programming Manual Example // 203 dpi(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_NORMAL, 0, 0, 10, 10 LabelConst.CLS_PRT_RES_300, LabelConst.CLS_UNIT_MILLI);...
  • Page 66: Drawbarcode Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.7 drawBarCode method Syntax int drawBarCode (String data, int symbology, int rotation, int thick, int narrow, int height, int x, int y,int showText) Parameters Parameter [IN/OUT] Description Setting range data [IN] String data ASCII code character string.
  • Page 67 CITIZEN Android Label Print SDK — Programming Manual Description Draws a 1D (one-dimensional) barcode with specifying options such as barcode type, rotation, thick/narrow bar width, coordinates and human readable text. * Supported thick/narrow bar ratio or data type depends on symbology. Refer to the command reference for details.
  • Page 68 CITIZEN Android Label Print SDK — Programming Manual // HIBC String hibc = "1234567890"; design.drawBarCode(hibc, LabelConst.CLS_BCS_HIBC, LabelConst.CLS_RT_NORMAL, 6, 2, 50, 10, 100, LabelConst.CLS_BCS_TEXT_SHOW); // CODABAR String codabar = "a1234567890b"; design.drawBarCode(codabar, LabelConst.CLS_BCS_CODABAR, LabelConst.CLS_RT_NORMAL, 6, 2, 40, 10, 10, LabelConst.CLS_BCS_TEXT_SHOW); // Interleaved2of5 W/BARS String int25 = "1234567890";...
  • Page 69 CITIZEN Android Label Print SDK — Programming Manual // Code93 String code93 = "1234ABCD"; design.drawBarCode(code93, LabelConst.CLS_BCS_CODE93, LabelConst.CLS_RT_NORMAL, 6, 6, 50, 10, 10, LabelConst.CLS_BCS_TEXT_SHOW); // ITF-14 String itf14 = "1234567890123"; design.drawBarCode(itf14, LabelConst.CLS_BCS_ITF14, LabelConst.CLS_RT_NORMAL, 5, 2, 50, 10, 100, LabelConst.CLS_BCS_TEXT_SHOW); // ZIP String zip = "123456789";...
  • Page 70 CITIZEN Android Label Print SDK — Programming Manual // UCC/EAN-128 Random Weight String uccean128randomweight = "1234567890123456789012345678909999"; design.drawBarCode(uccean128randomweight, LabelConst.CLS_BCS_UCCEAN128RANDOMWEIGHT, LabelConst.CLS_RT_NORMAL, 2, 2, 50, 10, 10, LabelConst.CLS_BCS_TEXT_SHOW); // Telepen String telepen = "1234567890"; design.drawBarCode(telepen, LabelConst.CLS_BCS_TELEPEN, LabelConst.CLS_RT_NORMAL, 2, 2, 50, 10, 100, LabelConst.CLS_BCS_TEXT_SHOW);...
  • Page 71: Drawmaxicode Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.8 drawMaxiCode method Syntax int drawMaxiCode (String[] data, int rotation, int x, int y) Parameters Parameter [IN/OUT] Description Setting range data [IN] String data ASCII code character string array rotation [IN] Direction of rotation...
  • Page 72: Drawpdf417 Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.9 drawPDF417 method Syntax int drawPDF417 (String data, int encoding, int rotation, int exp, int ECLevel, int x, int y) Parameters Parameter [IN/OUT] Description Setting range data [IN] String data * The characters available with the specified encoding.
  • Page 73: Drawdatamatrix Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.10 drawDataMatrix method Syntax int drawDataMatrix (String data, int encoding, int rotation, int exp, int ECLevel, int x, int y) Parameters Parameter [IN/OUT] Description Setting range data [IN] String data -Numeric: Up to 3,116 characters...
  • Page 74: Drawqrcode Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.11 drawQRCode method Syntax int drawQRCode (String data, int encoding, int rotation, int exp, int ECLevel, int x, int y) int drawQRCode (byte[] bytes, int rotation, int exp, int ECLevel, int x, int y)
  • Page 75: Drawaztec Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.12 drawAztec method Syntax int drawAztec (String data, int encoding, int rotation, int exp, int ECLevel, int x, int y) Parameters Parameter [IN/OUT] Description Setting range data [IN] String data * The characters available with the specified encoding.
  • Page 76: Drawgs1Databar Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.13 drawGS1DataBar method Syntax int drawGS1DataBar (String[] data, int type, int rotation, int exp, int x, int y) Parameters Parameter [IN/OUT] Description Setting range data [IN] String data ASCII code character string.
  • Page 77 CITIZEN Android Label Print SDK — Programming Manual // GS1 DataBar Truncation String[] truncation = new String[] { "1234567890123" }; design.drawGS1DataBar(truncation, LabelConst.CLS_GS1_DATABAR_TRUNCATION, LabelConst.CLS_RT_NORMAL, 3, 10, 210); // GS1 DataBar Stacked String[] stacked = new String[] { "1234567890123" }; design.drawGS1DataBar(stacked, LabelConst.CLS_GS1_DATABAR_STACKED, LabelConst.CLS_RT_NORMAL, 3, 10, 310);...
  • Page 78: Drawline Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.14 drawLine method Syntax int drawLine (int x1, int y1, int x2, int y2, int thickness) Parameters Parameter [IN/OUT] Description Setting range [IN] Start position 0000-9999 ( X-coordinate ) * The origin is at bottom-left.(0, 0)
  • Page 79: Drawrect Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.15 drawRect method Syntax int drawRect (int x, int y, int width, int height, int thickness) Parameters Parameter [IN/OUT] Description Setting range [IN] Start position 0000 - 9999 ( X-coordinate) * The origin is at bottom-left.(0, 0)
  • Page 80: Fillrect Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.16 fillRect method Syntax int fillRect (int x, int y, int width, int height, int pattern) Parameters Parameter [IN/OUT] Description Setting range [IN] Start position 0000 - 9999 ( X-coordinate) * The origin is at bottom-left.(0, 0)
  • Page 81: Drawcircle Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.17 drawCircle method Syntax int drawCircle (int x, int y, int radius) Parameters Parameter [IN/OUT] Description Setting range [IN] Start position 0000 - 9999 ( X-coordinate, center ) * The origin is at bottom-left.(0, 0)
  • Page 82: Fillcircle Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.18 fillCircle method Syntax int fillCircle (int x, int y, int radius, int pattern) Parameters Parameter [IN/OUT] Description Setting range [IN] Start position 0000 - 9999 ( X-coordinate, center ) * The origin is at bottom-left.(0, 0)
  • Page 83: Drawpolygon Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.19 drawPolygon method Syntax int drawPolygon (int[] x, int[] y) Parameters Parameter [IN/OUT] Description Setting range [IN] X points 0000 - 9999 * The origin is at bottom-left.(0, 0) [IN] Y points Description Draws a closed polygon defined by arrays of x and y coordinates.
  • Page 84: Fillpolygon Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.20 fillPolygon method Syntax int fillPolygon (int[] x, int[] y, int pattern) Parameters Parameter [IN/OUT] Description Setting range [IN] X points 0000 - 9999 * The origin is at bottom-left.(0, 0) [IN]...
  • Page 85: Embedrawdesigncommand Method

    CITIZEN Android Label Print SDK — Programming Manual 2.3.21 embedRawDesignCommand method Syntax int embedRawDesignCommand (byte[] data) Parameters Parameter [IN/OUT] Description Setting range data [IN] Design command Data of binary. Description Embeds raw printer commands to the label design. This allows adding raw label format commands individually.
  • Page 86: Appendix

    CITIZEN Android Label Print SDK — Programming Manual 3. Appendix 3.1. Specifying object position The coordinate origin of the label design is at bottom-left. The measurement unit, either inches or millimeters, is set in the printer. The MeasurementUnit property in the LabelPrinter class allows setting the measurement unit.
  • Page 87: Logging Function

    1: Access log 2: Error log - LogPath Specifies a folder to store the log files. "/temp/citizen" of SD card by default. - LogMaxSize Specifies maximum size to log file in MB. "0" sets the size to "unlimited." Log file name Log files will be stored with a file name "CSJLabelLib_"...
  • Page 88 CITIZEN Android Label Print SDK — Programming Manual --- Example, get from a property --- 2016/03/10 17:14:25.474 001 PROPERTY set printDarkness <- 10 : Success(0) * The logging function could be a "bottleneck" of processing since it tries to keep the information of every single execution of a method or access to a property.
  • Page 89: Predefined Constants

    CITIZEN Android Label Print SDK — Programming Manual 3.3. Predefined Constants Data Type Name Value Description Type Result/Error CLS_SUCCESS 0 Successfully completed CLS_E_CONNECTED 1001 Already connected CLS_E_DISCONNECT 1002 Not connected CLS_E_NOTCONNECT 1003 Failed to connect CLS_E_CONNECT_NOTFOUND 1004 Non supported model...
  • Page 90 CITIZEN Android Label Print SDK — Programming Manual CLS_PRT_FNT_6 6 System font:6 7 System font:7 CLS_PRT_FNT_7 CLS_PRT_FNT_8 8 System font:8 CLS_PRT_FNT_TRIUMVIRATE 9 Smooth font (Triumvirate) CLS_PRT_FNT_TRIUMVIRATE_B 10 Smooth font (Triumvirate Bold) CLS_PRT_FNT_KANJI 11 Kanji (Writing from left to right) CLS_PRT_FNT_KANJIT...
  • Page 91 CITIZEN Android Label Print SDK — Programming Manual (Windows) CLS_ENC_CDPG_WINDOWS_1251 1251 windows-1251 Cyrillic (Windows) Windows-1252Western European CLS_ENC_CDPG_WINDOWS_1252 1252 (Windows) CLS_ENC_CDPG_WINDOWS_1253 1253 windows-1253 Greek (Windows) CLS_ENC_CDPG_WINDOWS_1254 1254 windows-1254 Turkish (Windows) CLS_ENC_CDPG_WINDOWS_1255 1255 windows-1255 Hebrew (Windows) CLS_ENC_CDPG_WINDOWS_1256 1256 windows-1256 Arabic (Windows) CLS_ENC_CDPG_WINDOWS_1257...
  • Page 92 CITIZEN Android Label Print SDK — Programming Manual iso-2022-jp Japanese CLS_ENC_CDPG_ISO_2022_JP_S 50222 (JIS-Allow 1 byte Kana - SO/SI) CLS_ENC_CDPG_ISO_2022_KR 50225 iso-2022-kr Korean (ISO) x-cp50227 simplified Chinese CLS_ENC_CDPG_X_CP50227 50227 (ISO-2022) CLS_ENC_CDPG_EUC_JP 51932 euc-jp Japanese (EUC) CLS_ENC_CDPG_EUC_CN 51936 EUC-CN simplified Chinese (EUC)
  • Page 93 CITIZEN Android Label Print SDK — Programming Manual CLS_BCS_TELEPEN 123 Telepen Human readable CLS_BCS_TEXT_HIDE 0 Hide text of barcode CLS_BCS_TEXT_SHOW 1 Show Error correction CLS_PDF417_EC_LEVEL_0 0 Level 0 level (PDF417) CLS_PDF417_EC_LEVEL_1 1 Level 1 CLS_PDF417_EC_LEVEL_2 2 Level 2 CLS_PDF417_EC_LEVEL_3 3 Level 3...
  • Page 94 CITIZEN Android Label Print SDK — Programming Manual CLS_SPEEDSETTING_6 6 6:6.0inch(152.4mm) / sec 7 7:7.0inch(177.8mm) / sec CLS_SPEEDSETTING_7 CLS_SPEEDSETTING_8 8 8:8.0inch(203.2mm) / sec 9 9:9.0inch(228.6mm) / sec CLS_SPEEDSETTING_9 CLS_SPEEDSETTING_A 10 A:1.0inch( 25.4mm) / sec CLS_SPEEDSETTING_B 11 B:1.0inch( 25.4mm) / sec 12 C:2.0inch( 50.8mm) / sec...
  • Page 95 CITIZEN Android Label Print SDK — Programming Manual CITIZEN Android Label Print SDK - Programming Manual June 2, 2020 Version 1.04 CITIZEN SYSTEMS JAPAN CO., LTD. http://www.citizen-systems.co.jp/...

Table of Contents