Cloud Server Print
Overview
The SDK API provided by BIXOLON, is a JavaScript Library, which guides you to use B-gate’s special feature Cloud Server Print. This section is going to discuss about the features and functions supported by the B-gate SDK APIs.
The SDK APIs provided by BIXOLON has the ability to control and manage the B-gate Printer and the external BIXOLON printers (USB and Network) which are connected to the B-gate.
Our SDK APIs are easy to integrate with your web applications, by integrating these into your web applications; you can easily control, send and receive data from the B-gate and the printers which are connected to the B-gate as well.
API Download
SDK Download for Cloud Server PrintReference Guide
API Integration and Detailed Information
This section will explain the detailed information about our SDK API functions and how to integrate those into your web application.
In order to integrate our SDK API Library into your web application, first you have to add our SDK API Library files (bGateWebPrintAPI_WS.js and WS_parser.js) into your web application’s js folder and then call those files via <script> tag on your web application’s index.html file.
• Example <!DOCTYPE html> <html> <head> …. <script type="text/javascript" src="js/WS_parser.js"></script> <script type="text/javascript" src="js/bGateWebPrintAPI_WS.js"></script> …. </head> <body> …. </body> </html> |
Create SDK API Library Instance
In order to use our SDK API functions in your web application, first create an instance of our bGateWebPrintAPI Library on your JavaScript file and then use this instance to call our SDK API functions.
• Syntax var bGateWebPrintAPI(); • Parameters none • Example var bgtWebPrint = new bGateWebPrintAPI(); |
Send Data
The API sendData is use to send the print data to the designated B-gate.
• Syntax var sendData(ipAddr,shopID,devID); • Parameters ipAddr = Represents the designated IP Address WebApp Print : its B-gate IP Address Cloud Server Print : Its Cloud IP Address shopID = Represents the designated Shop Name. devID = Represents the target printer ID. • Example var ipAddr = "192.168.0.100"; var shopID = "BGATE_SAMPLE_SHOP"; var devID = "local_printer";
bgtWebPrint.sendData(ipAddr,shopID,devID); |
Alignment
The API makeAlign used to align the print data.
• Syntax var makeAlign (pos) • Parameters pos (position) = position Options: 'left' , 'right' , 'center' (Default: 'left') • Example bgtWebPrint.makeAlign({pos:'center'}); |
Print Text
The API makeText used to print the text data..
• Syntax var makeText(code, ics, font, wd, ht, uline, bold, reverse, updown, rotate, lsp, data) • Parameters code (code page) = Code Page Options: 'page0' ~ 'page5' , 'page16' ~ 'page19', 'page21' ~ 'page31', 'page33' ~ 'page42', 'page47', 'page255' (Default: page0)
ics (international code standard) = ICS Options: 'usa','france', 'germany', 'uk', 'denmark I' ,'sweden', 'italy', 'spain I' , 'japan', 'norway', 'denmark II', 'spain II', 'latinamerica', 'korea' (Default : usa) font = font options : 'fonta', 'fontb' 'fontc' (Default : fonta) wd = Text width options: '0' ~ '7' (Default : 0) ht = Text height options : '0' ~ '7' (Default : 0) uline = Under Line options : 'true' , 'false' (Default : false) bold = Bold options: 'true' , 'false' (Default : false) reverse(Interchange black and white) = Reverse options : 'true' , 'false' (Default : false) updown = upside-down options : 'true', 'false' (Default: false) rotate = Rotation Options : '0' , '90' (Default: 0) lsp (line space) = Line Space options : '0' ~ '255', '256'(=set line space to printer default) (Default : 256) data = Text Data • Example bgtWebPrint.maketext({code:'page0',ics:'us',font:'fonta',wd:'1',ht:'1',uline:'false',bold:'false', reverse:'false',rorate:'0',data:'Hello!World'}); bgtWebPrint.maketext({data:'Hello!World'}); bgtWebPrint.maketext({bold:'true',data:'Hello!World'}); bgtWebPrint.maketext({uline:'true', wd:'2',data:'Hello!World'}); |
Paper Feed
The API makePaperFeed used to feed the paper.
• Syntax var makePaperFeed (type, value) • Parameters type = Feed Type Options : 'line' , 'unit'(Default : line) value = Feed Value Options : '1' ~ '65535' (Default : 1) • Example bgtWebPrint.makePaperFeed({type:'line',value:'1'}); |
Print Image
The API makeImage used to print the Image Data.
• Syntax var makeImage (context, x, y, width, height) • Parameters context = HTML5 canvas context x = Image start x-coordinate position : '0' ~ '65535' y = Image start y-coordinate position : '0' ~ '65535' width = The Width of Image Data : '0' ~ '65535' height = The Height of Image Data : '0' ~ '65535' • Example Include a canvas in your html file, if you don’t want to display it then make it hidden. <!DOCTYPE html> <html> <head> …. <script type="text/javascript" src="js/WS_parser.js"></script> <script type="text/javascript" src="js/bGateWebPrintAPI_WS.js"></script> …. </head> <body> …. <div style="display:none;"> <canvas id="myHiddenCanvas" width="512" height="480"> </canvas> <img id="coupon" src="img/coupon.png" alt="canvas image"> </div> </body> </html> On your JS file get the context of your canvas and draw your image on canvas and then call our makeImage API to send image data. var dataURL="./img/coupon.png"; var image = new Image(); image.src = dataURL; var canvas = document.getElementById('myHiddenCanvas'); var context = canvas.getContext('2d'); context.drawImage(image, 0, 0, 512, 480); bgtWebPrint.makeImage(context, 0, 0, 512, 480); |
Print NV Logo
The API makeNVlogo used to print the NV Logo images stored in printer memory.
• Syntax var makeNVlogo (keycode, lsize) • Parameters keycode = Memory Location Options : '0' ~ '255' (Default: 0) lsize = NV Logo Size Options: 'normal', 'quadruple','dwd'(double width), 'dht'(double height) (Default: normal) • Example bgtWebPrint.makeNVvlogo({keycode:’0’,lsize:’normal’}) |
Print 1D Barcode
The API makeBarcode12 used to print 1-dimentional Barcode.
• Syntax var makeBarcode12 (type, hri, wd, ht, data) • Parameters type = Barcode Type Options : 'UPC_A' , 'UPC_E' , 'EAN13' , 'JAN13','EAN8',’JAN8', 'CODE39', 'ITF','CODABAR','CODE93' , 'CODE128' (Default: CODE39) hri (human readable interpretation)= HRI Print Location Options : 'none','above','below','both' (Default : none) wd (width) = Barcode Width Options : '0' ~ '255' (Default : 2) ht (height) = Barcode Height Options : '0' ~ '255'(Default : 162) data = Barcode Data • Example bgtWebPrint.makeBarcode12({data:’123456789123’, type:’code128’,hri:’none’,wd:’2’,ht:’162’}); |
Print 2-D Symbol PDF417
The API makePDF417 used to print 2-d symbol PDF471
• Syntax var makePDF417 (col, row, wd, ht, level, mode, data) • Parameters col = Columns Options: '0' ~ '30' (Default: 0) row = Row Options: '0', '3' ~ '90'(Default: 0) wd = Module Width Options : '1' ~ '4'(Default : 3) ht = Module Height Options : '2' ~ '4'(Default : 3) level = Error Correction Level Options : '0' ~ '8' (Default : 0) mode = PDF417 Mode options: '0'(Standard Mode), '1'(Simplified Mode) (Default : 0) data = 2-D symbol data • Example bgtWebPrint.makePDF417({data:'http://bixolon.com',col:'0',row:'0', wd:'3',ht:'3', mode:'0'}); |
Print 2-D Symbol QR Code
The API makeQRCODE used to print 2-d symbol QR Code
• Syntax var makeQRCODE (model, size, level, data) • Parameters model = QR Code Model Options : 'mod1' , 'mod2' (Default : mod2) size = QR Code Size Options : '1' ~ '8'(Default : 3) level = Error Correction Level Options: '0' ~ '3' (Default: 0) data = 2-D Symbol data • Example bgtWebPrint.makeQRCODE({data:'http://bixolon.com',model:'mod2',size:'3',level:'0'}); |
Paper Cut
The API makePaperCut used to print paper cut.
• Syntax var makePaperCut (cuttype) • Parameters cuttype = Paper Cut Type Options :'feed','nofeed'(Default : feed) • Example bgtWebPrint.makePaperCut({cuttype:'feed'}); |
Make Cash Draw Kick Out
The API makeDKout used to manage Cashdrawer Kick out information.
• Syntax var makeDKout (connector, duration) • Parameters connector = Cash Draw Connector Pin Options : 'pin2' , 'pin5' (Default : pin2) duration = Pulse time Duration milliseconds : '50','100','150','200','250','300','400','500' (Default : 200) • Example bgtWebPrint.makeDKout({connector:'pin2',duration:'200'}); |
Internal Buzzer Sound
The API makeBuzzer used to make internal buzzer sound.
• Syntax var makeBuzzer () • Parameters none • Example bgtWebPrint.makeBuzzer(); |
Print Direct I/O Command
The API makeCmd used to print Direct I/O Commands.
• Syntax var makeCmd (command) • Parameters command = ESC/POS data command in Hexadecimal (excluding 0x) • Example bgtWebPrint.makeCmd("1d 28 4c 06 00 30 45 30 30 01 01"); |
Printer ReInit
The API makeReinit used to reinitialize the printer settings.
• Syntax var makeReinit () • Parameters none • Example bgtWebPrint.makeReinit(); |
Select Page Mode
The API SelectPageMode is used to enable/ disable the Page Mode printing.
• Syntax var SelectPageMode (enable) • Parameters - enable = Enable or disable Page Mode Options:'true' , ‘false' (Default : true) • Example bgtWebPrint.SelectPageMode({enable:’true’ }) |
Set PrintArea In Page Mode
The API SetPrintAreaInPM is used to set the size and position of the printing area.
• Syntax var SetPrintAreaInPM (startX,startY,width,height) • Parameters - startX = X-coordinates of the Print Area Options: '0' ~ '65535' (Default : “0”) - startY = Y-coordinates of the Print Area Options: '0' ~ '65535' (Default : “0”) - width = Width of the Print Area Options: '0' ~ '65535' (Default : “384”) - height = Height of the Print Area Options: '0' ~ '65535' (Default : “840”) • Example bgtWebPrint.SetPrintAreaInPM({startX:’0’, startY:’0’, width:’384’, height:’840’}) |
Set Print Direction In Page Mode
The API SetPrintDirectionInPM is used to set the printing direction in the Page Mode.
• Syntax var SetPrintDirectionInPM (rotate) • Parameters - rotate = Print Rotate Options: '0', '90', '180', '270' (Default : '0') • Example bgtWebPrint.SetPrintDirectionInPM ({rotate:’0’}) |
Set Vertical Position In Page Mode
The API SetVerticalPositionInPM is used to set the vertical position in the Page Mode.
• Syntax var SetVerticalPositionInPM (position,relative) • Parameters - position = Set Starting Position Options: '0' ~ '65535' - relative = Set Relative or absolute position from the current Position Options: 'true', 'false' (Default : ‘false’) • Example bgtWebPrint.SetVerticalPositionInPM({position:’160’,relative:’false’}) |
Set Horizontal Position In Page Mode
The API SetHorizontalPositionInPM is used to set the horizontal position in the Page Mode.
• Syntax var SetHorizontalPositionInPM (position,relative) • Parameters - position = Set Starting Position Options: '0' ~ '65535' - relative = Set Relative or absolute position from the current Position Options: 'true', 'false' (Default : ‘false’) • Example bgtWebPrint.SetHorizontalPositionInPM({position:’40’,relative:’false’}) |
Print Data In Page Mode
The API PrintDataInPM is used to Print all the data in the printer buffer if set to Page Mode and the printer switches to Standard Mode after printing.
• Syntax var PrintDataInPM () • Parameters None • Example bgtWebPrint.PrintDataInPM (); |
Get Connected Printer List
The API getDeviceList used to get the printers device ID information, which are connected with B-gate.
• Syntax var getDeviceList (ipAddr,shopID, ListInputBoxID); • Parameters ipAddr = Represents the designated IP Address WebApp Print : its B-gate IP Address Cloud Server Print : Its Cloud IP Address shopID = Represents the designated Shop Name. ListInputBoxID = Represents the HTML Input Item ID name (where you want to display the device list information) • Example <In your html file> <!DOCTYPE html> <html> <head> …. <script type="text/javascript" src="js/WS_parser.js"></script> <script type="text/javascript" src="js/bGateWebPrintAPI_WS.js"></script> …. </head> <body> … <select id="devicelist"> </select> </body> </html> <In your js File> var ipAddr = "192.168.0.100"; var shopID = "BGATE_SAMPLE_SHOP"; var ListInputBoxID = "devicelist"; bgtWebPrint.getDeviceList (ipAddr,shopID, ListInputBoxID); |
Get Shop List
The API getShopList used to get the Shop ID information. In WebApp Print, it will get the B-gate Shop ID Information, However in Online Order print, it will get the all the shop ID, which are registered to Cloud Server.
• Syntax var getShopList (ipAddr, ListInputBoxID); • Parameters ipAddr = Represents the designated IP Address WebApp Print: B-gate it’s B-gate IP Address Cloud Server Print: It’s Cloud IP Address ListInputBoxID = Represents the HTML Input Item ID name (where you want to display the shop list information). • Example <In your html file> <!DOCTYPE html> <html> <head> …. <script type="text/javascript" src="js/WS_parser.js"></script> <script type="text/javascript" src="js/bGateWebPrintAPI_WS.js"></script> …. </head> <body> … <select id="shoplist"> </select> </body> </html> <In your js File> var ipAddr = "192.168.0.100"; var ListInputBoxID = "shoplist"; bgtWebPrint.getShopList(ipAddr, ListInputBoxID); |
Get Offline Shop List
Get Offline Shop List
The API getOfflineShops used to get the all the offline Shops ID information from the Cloud Server. Its supports only Cloud Server print, it will get the all the offline shops ID, which are registered with the Cloud Server.
• Syntax var getOfflineShops (ipAddr, ListInputBoxID); • Parameters ipAddr = Represents the designated IP/Domain Address - It’s Cloud IP/Domain Address ListInputBoxID = Represents the HTML Input Item ID name (where you want to display the shop list information). • Example <In your html file> <!DOCTYPE html> <html> <head> …. <script type="text/javascript" src="js/WS_parser.js"></script> <script type="text/javascript" src="js/bGateWebPrintAPI_WS.js"></script> …. </head> <body> … <select id="shoplist"> </select> </body> </html> <In your js File> var ipAddr = "cloud-bixolon.kr"; var ListInputBoxID = "offineshoplist"; bgtWebPrint.getOfflineShops(ipAddr, ListInputBoxID); |
LABEL API Integration and Detailed Information
This section will explain the detailed information about our Label SDK API functions and how to integrate those into your web application.
In order to integrate our SDK API Library into your web application, first you have to add our SDK API Library files (bGateWebPrintAPI_WS.js and WS_parser.js) into your web application’s js folder and then call those files via <script> tag on your web application’s index.html file.
• Example <!DOCTYPE html> <html> <head> …. <script type="text/javascript" src="js/WS_parser.js"></script> <script type="text/javascript" src="js/bGateWebPrintAPI_WS.js"></script> …. </head> <body> …. </body> </html> |
Create SDK API Library Instance
In order to use our SDK API functions in your web application, first create an instance of our bGateWebPrintAPI Library on your JavaScript file and then use this instance to call our SDK API functions.
• Syntax var bGateWebPrintAPI(); • Parameters none • Example var bgtWebPrint = new bGateWebPrintAPI(); |
Send Label Data
The API sendLabelData is used to send the Label print data to the designated B-gate.
• Syntax var sendLabelData (ipAddr,shopID,devID); • Parameters ipAddr = Represents the designated Cloud IP/Domain Address shopID = Represents the designated Shop Name. devID = Represents the target printer ID. • Example var ipAddr = "cloud-bixolon.kr"; var shopID = "BGATE_SAMPLE_SHOP"; var devID = "label_printer1"; bgtWebPrint.sendLabelData(ipAddr,shopID,devID); |
Feed One Lable
The API FeedOneLabel is used to feed one label data to the designated Label Printer.
• Syntax var FeedOneLabel(); • Parameters - None • Example bgtWebPrint.FeedOneLabel(); |
Set Speed
The API SetSpeed is used to set the printing speed to the designated Label Printer.
• Syntax var SetSpeed(ips); • Parameters ips = Set Printing Speed, Options: 0 to 12 ips options:
(Default = 4) • Example bgtWebPrint.SetSpeed({ips:4}); |
Set Density
The API SetDensity is used to set the printing density to the designated Label Printer.
• Syntax var SetDensity(density); • Parameters density = Set Printing Density, Options: 0 to 20 (Default : 0) • Example bgtWebPrint.SetDensity ({density:5}); |
Set Orientation
The API SetOrientation is used to set the printing Orientation of the designated Label Printer.
• Syntax var SetOrientation(ori); • Parameters ori= Set Printing Orientation, Options: TOP_TO_BOTTOM, BOTTOM_TO_TOP. ( Required) • Example bgtWebPrint.SetOrientation({ori:TOP_TO_BOTTOM}); |
Set Cutter
The API SetCutter is used to enable or disable Auto-cut action after printing of the designated Label Printer.
• Syntax var SetCutter(auto, period); • Parameters auto = Enable/Disable Cutter, Options: 0 and 1 (Default:0) period – Cutting Period, Number of pages between two cuttings. Options: 1~ N(Default:0) • Example bgtWebPrint.SetCutter({auto:1,period:1}); |
Set Offset
The API SetOffset is used to set the offset length between black marks or gap and dotted lines of the designated Label Printer.
• Syntax var SetOffset(oset); • Parameters oset= Set Offset Length, Options: -100 ~ 100( Default:0)
• Example bgtWebPrint.SetOffset({oset:0}); |
Set Cut Position
The API SetCutPosition is used to regulate the label cutting location after the printing of the designated Label Printer.
• Syntax var SetCutPosition(pos); • Parameters pos =Regulates the cut position, Options: -100 ~ 100( Default:0) • Example bgtWebPrint.SetCutPosition({pos:0}); |
Set Printing Type
The API SetPrintingType is used to select the Thermal Direct or Thermal Transfer Printing type of the designated Label Printer.
• Syntax var SetPrintingType(type); • Parameters type = Select Direct or Transfer Printing, Options: DIRECT, TRANSFER ( Required) • Example bgtWebPrint.SetPrintingType({type:DIRECT}); |
Set Back Feed
The API SetBackFeed is used to set the back-feed action before start printing on the designated Label Printer.
• Syntax var SetBackFeed(backfeed,step); • Parameters backfeed = Set Back-Feed action, Options: 0,1 ( Default:0) step = Back feeding step quantity • Example bgtWebPrint.SetBackFeed({backfeed:1,step:0}); |
Set Paper
The API SetPaper is used to set the size of label and media type of the designated Label Printer.
• Syntax var SetPaper(wd,ht,mtype,offset,glen); • Parameters wd = Set Label Width[dots], Options: width in dots( Default:832 dots) ht = Set Label Length[dots] Options: Height in dots (default:1216 dots) mtype = Media Type Options: GAP, CONTINUOUS, BLACK_MARK (Required) offset = Offset length Options: length betwwen Black Mark or gap and perforation line[dots] (Default :20) glen = Gap Length or thickness of black line [dots] Options: Length in dots (Default: 0) • Example bgtWebPrint.SetPaper({wd:832,ht:1216,mtype:GAP,offset:20, glen:0}); |
Set Margin
The API SetMargin is used to set the image buffer marginal value of the designated Label Printer.
• Syntax var SetMargin(hz,vt); • Parameters hz = Set Horizontal margin[dots], Options: value in dots( Default:0 dots) vt = Set Vertical margin[dots] Options: value in dots (Default:0 dots) • Example bgtWebPrint.SetMargin({hz:100,vt:100}); |
Set Character Set
The API SetCharacterSet is used to set the international character set and code table of the designated Label Printer.
• Syntax var SetCharacterSet(ics,code); • Parameters ics = Set International Character Set, Options: usa, france, Germany, uk, denmarkI, Sweden, Italy,spainI, Norway, denmarkII, japan, spainII, latinamerica, korea, Slovenia,china ( Required) code = Set the Code Pages (Required) Options:
• Example bgtWebPrint.SetCharacterSet({ics:usa,code:CP437}); |
Print Device Font
The API PrintDeviceFont is used to print the text string at the designated Label Printer.
• Syntax var PrintDeviceFont(xPOS, yPOS, fontName, xMulti, yMulti, rSpace, rotate, reverse, bold, align, data); • Parameters xPOS = Set Horizontal Position [dots] Options: value in dots ( Required) yPOS = Set Vertical Position [dots] Options: value in dots ( Required) fontName = Font Selection (Required) Options:
xMulti = Set Horizontal Multiplier, Options (1 ~ 4) (Required) yMulti = Set Vertical Multiplier, Options (1 ~ 4) (Required) rSpace = Set Right-side character spacing [dots] Options: value in dots. +/- (can be used) (Required) rotate = Set Rotation Options:
(Default:0) reverse = Set Reverse Printing Options: 0,1(0 – Normal Printing, 1- Reverse Printing) (Default:0) bold = Set Bold Options: 0,1(0 – Normal, 1 - Bold) (Default:0) align = Set Alignment Options:
(Default:left) data = String Data to be printed Note: To print ’or \, then \’or \\ must be typed. • Example
bgtWebPrint.PrintDeviceFont({xPOS:0,yPOS:0,fontName:
DEVICE_ENG_19X30,xMulti:1,yMulti:1,rSpace:0,rotate:0,
reverse:0, bold:0,align:left,data:”Bixolon Label Printer”});
|
Print Vector Font
The API PrintVectorFont is used to print the text string at the designated Label Printer.
• Syntax var PrintVectorFont(xPOS, yPOS, fontName, fontWidth, fontHeight, rSpace, bold, reverse, italic, rotate, align, direction, data); (*) Parameters xPOS = Set Horizontal Position [dots] Options: value in dots ( Required) yPOS = Set Vertical Position [dots] Options: value in dots ( Required) fontName = Font Selection (Required) Options:
fontWidth = Set Font Width [dot], Options - Value in dots (Required) fontHeight = Set Font Height [dot], Options - Value in dots (Required) rSpace = Set Right-side character spacing [dots] Options: value in dots. +/- (can be used) (Required) bold = Set Bold Options: 0,1(0 – Normal, 1 - Bold) (Default:0) reverse = Set Reverse Printing Options: 0,1(0 – Normal Printing, 1- Reverse Printing) (Default:0) italic = Set Text Style Options: 0,1(0 – Normal, 1 - Italic) (Default:0) rotate = Set Rotation Options:
(Default:0) align = Set Alignment Options:
(Default:left) direction = Set Text write direction Options:
(Default:lefttoright) data = String Data to be printed
Note: To print ’or \ then \’or \\ must be typed.
(*) Example
bgtWebPrint.PrintVectorFont({xPOS:50,yPOS:100,fontName: VECTOR_ASCII,fontWidth:25,fontHeight:25,rSpace:+1,bold:0,reverse:0,
italic:0,rotate:0,align:left,direction:lefttoright,data:”BIXOLON LABEL PRINTER”});
|
Print Circle
The API Print Circle is used to draw circles on the designated Label Printer.
• Syntax var PrintCircle(xPOS,yPOS,csize,multiplier); • Parameters xPOS = Set Horizontal Position [dots] Options: value in dots ( Required) yPOS = Set Vertical Position [dots] Options: value in dots ( Required) csize = Set Circle Selection(Required) Options: 1 ~ 6 (Required)
multiplier = Options : 1 ~ 4 (Required) • Example bgtWebPrint.PrintCircle({xPOS:100,yPOS:200,csize:2,multiplier:1}); |
Print Block
The API PrintBlock is used to draw blocks/lines on the designated Label Printer.
• Syntax var PrintBlock(startX, startY,endX,endY,option,thickness); • Parameters startX = Set Horizontal Start Position [dots] Options: value in dots ( Required) startY = Set Vertical Start Position [dots] Options: value in dots ( Required) endX = Set Horizontal End Position [dots] Options: value in dots ( Required) endY = Set Vertical End Position [dots] Options: value in dots ( Required) option = Set Block Type Options Selection(Required) Options: (Required)
thickness = Options : none or size in value (Default: none) If the selected type is BLOCK_SLOPE or BLOCK_BOX then thickness value must be given otherwise just set none.
• Example bgtWebPrint.PrintBlock({startX:190,startY:50,endX:700,endY:52,
option: BLOCK_SLOPE,thickness:2});
|
Print 1D Barcode
The API Print1DBarcode is used to draw 1D Barcode on the designated Label Printer.
• Syntax var Print1DBarcode(xPOS, yPOS, bctype,endY, nwd, wd, ht, rotate, hri, zwd, data); • Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default: 78) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 196) bctype = Set Barcode Type Options Selection(Required) Options: CODE39, CODE128, I2OF5, CODABAR, CODE93, UPC-A, UPC-E, EAN13, EAN8, EAN128, CODE11, PLANET, INDUSTRIAL2OF5,STANDARD2OF5, LOGMARS, EXTENSION, POSTNET. (Default: CODE128) nwd = Set Narrow Bar Width [dots] Options: value in dots (Default: 2) wd = Set Wide Bar Width [dots] Options: value in dots (Default: 6) ht = Set Barcode Height [dots] Options: value in dots (Default: 100) rotate = Set Rotation Options:
(Default:0) hri = Set HRI (Human Readable Interpretation) Options:
(Default:none) swd = Set Quiet Zone Width, Options – 0 ~ 20 (Default:0) data = Set Barcode Data (Default: “>A1234567890”) • Example bgtWebPrint.Print1DBarcode({xPOS:78,yPOS:196,bctype:’CODE128’,nwd:2,wd:6, ht:100,rotate:0, hri:’none’,zwd:0,data:”>A1234567890”}); |
Print Maxicode
The API PrintMaxiCode is used to draw 2D Maxicode on the designated Label Printer.
• Syntax var PrintMaxiCode(xPOS, yPOS, mod, data); • Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Required) yPOS = Set Vertical Start Position [dots] Options: value in dots (Required) mod = Set the Type of Mode Options:MODE0, MODE2, MODE3, MODE4(Required) data = Set Maxicode Data, Data format is depends on MODE Type
• Example bgtWebPrint.PrintMaxiCode({xPOS:200,yPOS:200,mod:MODE0,data:” 999,840,06810,7317,THIS IS A TEST OF MODE 0 STRUCTURED CARRIER MESSAGE ENCODING. THIS IS AN 84 CHAR MSG”}); |
Print PDF417
The API PrintPDF417 is used to draw 2D PDF417 data on the designated Label Printer.
• Syntax var PrintPDF417(xPOS, yPOS, rowcount, colcount, level, dataComp, hri, orgin, wd, ht , rotate, data); • Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:100) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 750) rowcount = Set Maximum Row Count Options: 3 ~ 90 (Default: 30) colcount = Set Maximum Column Count Options: 1 ~ 30 (Default: 5) level = Set Error Correction Level Options : 0 ~ 8 (Default 0)
dataComp = Set Data Compression Method Options: COMP_TEXT, COMP_NUM, COMP_BINARY
(Default:COMP_TEXT) hri = Set HRI (Human Readable Interpretation) Options: none = Not Printed Below = Print below the barcode (Default:below) orgin = Set Barcode Origin Point Options: center = Center of Barcode Upperleft= Upper Left corner of Barcode (Default: upperleft) wd = Set Module Width Options: 2 ~ 9 (Default: 3) ht = Set Bar Height Options: 4 ~ 99 (Default: 10) rotate = Set Rotation Options:
(Default:0) data = Set PDF417 Data, Data format ASCII or Binary data. • Example bgtWebPrint.PrintPDF417({xPOS:100,yPOS:750,colcount:5,rowcount:30,level:0, dataComp:’COMP_TEXT’,hri:’below’,orgin:’upperleft’,wd:3,ht:10,rotate:0, data:”BIXOLONLabel Printer SLPDX420”}); |
Print QRCode
The API PrintQRCode is used to draw 2D QRCode data on the designated Label Printer.
• Syntax var PrintQRCode(xPOS, yPOS, model, level, size, rotate, data); • Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:100) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 750) model = Set the QRCode Model Options: MOD1, MOD2 (Default: MOD2) level = Set Error Correction Level Options :
(Default : ECC25_Q) size = Set Barcode Size Options: 1 ~ 4 (Default: 3) rotate = Set Rotation Options:
(Default:0) data = Set QRCode Data, Data format ASCII or Binary data. • Example bgtWebPrint.PrintQRCode({xPOS:200,yPOS:100,model:MOD2,level:’ECC25_Q’,size:3, rotate:0,data:”www.bixolon.com”}); |
Print Data Matrix
The API PrintDataMatrix is used to draw 2D DataMatrix data on the designated Label Printer.
• Syntax var PrintDataMatrix(xPOS, yPOS, size, reverse, rotate, data); • Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:200) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 100) size = Set Barcode Size Options: 1 ~ 4 (Default: 3) reverse = Set Reverse Options : NORMAL, REVERSE (Default: NORMAL) rotate = Set Rotation
Options:
(Default:0) data = Set DataMatrix Data, Data format ASCII or Binary data.
• Example bgtWebPrint.PrintDataMatrix({xPOS:200,yPOS:100,size:3,reverse:’NORMAL’, rotate:0,data:”BIXOLON LABEL PRINTER”}); |
Print Aztec
The API PrintAztec is used to draw 2D Aztec data on the designated Label Printer.
• Syntax
var bgtWebPrint.PrintAztec ({xPOS, yPOS, size, interpretation,
symbolsize, menusymbol, numsymbol, id, rotate, data});
• Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:100) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 100) size = Set Barcode Size Options: 1 ~ 10 (Default: 5) interpretation = Set Extended Channel Interpretation Code Options: enable, disable (Default: disable) symbolsize = Set Error Control and Symbol Size/Type Options : 0 ~ 300 ( Default : 0)
menusymbol = Set Menu Symbols Options: enable, disable (Default :disable) Numsymbol = Set Number of Symbols for structured append Options: 1 ~ 26 (Default :1) id = Optional ID field for Structured append Options: string maximum 24 characters (Default: 1) rotate = Set Rotation Options:
(Default:0) data = Set Aztec Data, Data format ASCII or Binary data.
• Example bgtWebPrint.PrintAztec({xPOS:100,yPOS:100,size:5, interpretation:’disable’,
symbolsize:0,menusymbol:’disable’, numsymbol:1,id:1,rotate:0,
data:”THIS IS AZTEC BARCODE TESTTHIS IS AZTEC BARCODE TEST”});
|
Print CODE49 Barcode
The API PrintCode49 is used to draw 2D CODE49 barcode data on the designated Label Printer.
• Syntax var PrintCode49(xPOS, yPOS, nwd, wd, ht, hri, mode, rotate, data); • Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:100) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 100) nwd = Set Narrow Bar Width [dots] Options: Value in dots (Default:2) wd = Set Wide Bar Width [dots] Options: Value in dots (Default:7) ht = Set Barcode Height [dots] Options: Value in dots (Default:22) hri = Set HRI (Human Readable Interpretation) Options:
(Default: none) mode = Set Starting Mode Options : 0 ~ 7
(Default: 7) rotate = Set Rotation Options:
(Default:0)
data = Set Code49 Data, Data format ASCII or Binary data.
• Example bgtWebPrint.PrintCode49({xPOS:100,yPOS:100,nwd:2,wd:7,ht:22,hri:’none’,
mode:7,rotate:0,data:”12345ABC” });
|
Print CODABLOCK Barcode
The API PrintCODABLOCK is used to draw 2D CODABLOCK barcode data on the designated Label Printer.
• Syntax
var PrintCODABLOCK({xPOS, yPOS, nwd, wd, ht, secure, datacol, mode, encode,
rotate, data});
• Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:10) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 100) nwd = Set Narrow Bar Width [dots] Options: Value in dots (Default:2) wd = Set Wide Bar Width [dots] Options: Value in dots (Default:5) ht = Set Barcode Height [dots] Options: Value in dots (Default:30) secure = Set Security Level Options: enable, disable (Default: disable) datacol = Set Number of characters per row( data coloumns) Options: 2 ~ 62 ( Default : 30) mode = Set Mode Options:
(Default: CODABLOCK_F) encode = Set Number of Rows to Encode Options : 1 ~ 18, the encode value is depends on the Selected mode
(Default: 4) rotate = Set Rotation Options:
(Default:0) data = Set CODABLOCK Data, Data format ASCII or Binary data.
• Example bgtWebPrint.PrintCODABLOCK({xPOS:10,yPOS:100,nwd:2,wd:5,ht:30,secure:’disable’, datacol:30,mode:’CODABLOCK_F’, encode:4, rotate:0, data:” BIXOLON BARCODE TEST 123BIXOLON BARCODE TEST 123BIXOLON BARCODE TEST 123BIXOLON BARCODE TEST 123”}); |
Print MicroPDF Barcode
The API PrintMicroPDF is used to draw 2D MicroPDF barcode data on the designated Label Printer.
• Syntax
var PrintMicroPDF({xPOS,yPOS,wd,ht,mode,rotate,data:bdata});
• Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:100) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 300) wd = Set Module Width Options: 2 ~ 8 (Default:2) ht = Set Barcode Height [dots] Options: 1 ~ 99 (Default:3) mode = Set Mode Options: 0 ~ 33 (Default: 20)
rotate = Set Rotation Options:
(Default:0) data = Set MicroPDF Data, Data format ASCII or Binary data.
• Example bgtWebPrint.PrintMicroPDF({xPOS:100, yPOS:100, wd:2, ht:3, mode:20, rotate:0, data:”ABCDEFGHIJKLMN1234567890”}); |
Print IMB Special Barcode
The API PrintIMBSplBar is used to draw IMB special barcode data on the designated Label Printer.
• Syntax
var PrintIMBSplBar({xPOS,yPOS,rotate,hri,data });
(*) Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:100) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 100) rotate = Set Rotation Options:
(Default:0) hri = Set HRI (Human Readable Interpretation) Options:
(Default: none) data = Set IMB Special Barcode Data, Data format ASCII or Binary data. (*) Example bgtWebPrint.PrintIMBSplBar({xPOS:100, yPOS:100, rotate:0, hri:’none’, data:” 0123456709498765432101234567891”}); |
Print MSI Special Barcode
The API PrintMSISplBar is used to draw MSI special barcode data on the designated Label Printer.
• Syntax
var PrintMSISplBar({xPOS, yPOS, nwd, wd, ht, ckdigit, digithri, rotate, hri, data});
• Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:100) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 100) nwd = Set Narrow Bar Width [dots] Options: Value in dots (Default:2) wd = Set Wide Bar Width [dots] Options: Value in dots (Default:7) ht = Set Barcode Height [dots] Options: Value in dots (Default:150) ckdigit = Set Check Digit Options:
(Default:1) digithri = Print Check Digit in HRI Options:
(Default: enable) rotate = Set Rotation Options:
(Default:0) hri = Set HRI (Human Readable Interpretation) Options:
(Default: below) data = Set MSI Special Barcode Data, Data format ASCII or Binary data. • Example bgtWebPrint.PrintMSISplBar({xPOS:100, yPOS:100, nwd:2, wd:7, ht:150, ckdigit:1, digithri:’enable’, rotate:0, hri:’below’, data:”123456”}); |
Print Plessey Special Barcode
The API PrintPLESSEYSplBar is used to draw Pleassey special barcode data on the designated Label Printer.
• Syntax
var PrintPLESSEYSplBar({xPOS, yPOS, nwd, wd, ht, digithri, rotate, hri, data});
• Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:100) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 100) nwd = Set Narrow Bar Width [dots] Options: Value in dots (Default:2) wd = Set Wide Bar Width [dots] Options: Value in dots (Default:7) ht = Set Barcode Height [dots] Options: Value in dots (Default:150) digithri = Print Check Digit in HRI Options:
(Default: enable) rotate = Set Rotation Options:
(Default:0) hri = Set HRI (Human Readable Interpretation) Options:
(Default: below) data = Set Plessey Special Barcode Data, Data format ASCII or Binary data. • Example bgtWebPrint.PrintPLESSEYSplBar({xPOS:100, yPOS:100, nwd:2, wd:7, ht:150, digithri:’enable’, rotate:0, hri:’below’, data:”12345”}); |
Print TLC39 Special Barcode
The API PrintTLC39SplBar is used to draw TLC39 special barcode data on the designated Label Printer.
• Syntax
var PrintTLC39SplBar({xPOS, yPOS, nwdc39, wdc39, htc39, htpdf, nwdpdf, rotate, data});
• Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:50) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 100) nwdc39 = Set Narrow Bar Width of the Code 39 [dots] Options: Value in dots (Default:2) wdc39 = Set Wide Bar Width of the Code 39 [dots] Options: Value in dots (Default:4) htc39 = Set Height of the Code 39 [dots] Options: Value in dots (Default:50) htpdf = Set Row Height of the Micro PDF417 Options: 1 ~ 255 ( Default:3) nwdpdf = Set Narrow Bar Width of the Micro PDF417 Options: 1 ~ 10 ( Default: 2) rotate = Set Rotation Options:
(Default:0) data = Set TLC39 Special Barcode Data, Data Format: ASCII or Binary data. Data Structure: ECI Number, Serial Number, Additional Data
• Example bgtWebPrint.PrintTLC39SplBar({xPOS:50, yPOS:100, nwdc39:2, wdc39:4, htc39:50, htpdf:3, nwdpdf:2, rotate:0, data:” 123456,ABCD12345678901234,5551212,88899”}); |
Print RSS Special Barcode
The API PrintRSSSplBar is used to draw RSS special barcode data on the designated Label Printer.
• Syntax
var PrintRSSSplBar({xPOS, yPOS, bartype, magnify, sepht, ht,
segwd, rotate, data});
• Parameters xPOS = Set Horizontal Start Position [dots] Options: value in dots (Default:50) yPOS = Set Vertical Start Position [dots] Options: value in dots (Default: 100) bartype = Set the RSS Barcode Type Options:
(Default : RSS) magnify = Set Magnification Options: 1 ~ 10 (Default:2) sepht = Set Separator Height Options: 1 ~ 2 (Default:1) ht = Set Barcode Height [dots], This Parameter only affects the UCC/EAN and CC-A/B/C Barcode Type. Options: Value in dots (Default:20) segwd = Set Segment Width, This parameter affects only RSS Expanded Barcode. Options: 1 ~ 22 ( Only Even Numbers)(Default:10) rotate = Set Rotation Options:
(Default:0) data = Set RSS Special Barcode Data, Data format ASCII or Binary data. • Example bgtWebPrint.PrintRSSSplBar({xPOS:50, yPOS:100, bartype:’RSS’, magnify:2, sepht:1, ht:20, segwd:10, rotate:0, data:” 12345678901|this is composite info”}); |
Print Image
The API PrintImage used to draw the image data on the designated label printer.
• Syntax
var printImage(context, x, y, width, height,xPOS, yPOS)
• Parameters context = HTML5 canvas context x = Image start x-coordinate position in Canvas : '0' ~ '65535' y = Image start y-coordinate position in canvas: '0' ~ '65535' width = The Width of Image Data : '0' ~ '65535' height = The Height of Image Data : '0' ~ '65535' xPOS = Set Horizontal Start Position [dots] yPOS = Set Vertical Start Position [dots] • Example Include a canvas in your html file, if you don’t want to display it then make it hidden. <!DOCTYPE html> <html> <head> … <script type="text/javascript" src="js/WS_parser.js"></script> <script type="text/javascript" src="js/bGateWebPrintAPI_WS.js"></script> … </head> <body> … <div style="display:none;"> <canvas id="myHiddenCanvas" width="512" height="480"> </canvas> <img id="coupon" src="img/coupon.png" alt="canvas image"> </div> </body> </html> On your JS file get the context of your canvas and draw your image on canvas and then call our PrintImage API to send image data.
var dataURL="./img/coupon.png";
var image = new Image(); image.src = dataURL;
var canvas = document.getElementById('myHiddenCanvas');
var context = canvas.getContext('2d');
context.drawImage(image, 0, 0, 512, 480);
bgtWebPrint.PrintImage(context, 0, 0, 512, 480, 300, 500);
|
Start Print
The API PrintS used to start printing the content of the image buffer on the designated label printer.
• Syntax
var printS(labelset,ncopies);
• Parameters labelset = Number of Label Sets Options: 1 ~ 65535 (Default:1) ncopies = Number of copies of each Label Options: 1 ~ 65535 (Default:1) • Example
bgtWebPrint.printS({labelset:1,ncopies:1});
|
Get Connected Label Printer List
The API getLabelDeviceList used to get the Label printers device ID information, which are connected with B-gate.
• Syntax var getLabelDeviceList (ipAddr,shopID, ListInputBoxID); • Parameters ipAddr = Represents the designated IP/Domain Address - Its Cloud IP/Domain Address shopID = Represents the designated Shop Name. ListInputBoxID = Represents the HTML Input Item ID name (where you want to display the device list information). • Example <In your html file> <!DOCTYPE html> <html> <head> … <script type="text/javascript" src="js/WS_parser.js"></script> <script type="text/javascript" src="js/bGateWebPrintAPI_WS.js"></script> … </head> <body> … <select id="devicelist"> </select> </body> </html> <In your js File> var ipAddr = “coud-bixolon.kr”; var shopID = “BGATE_SAMPLE_SHOP”; var ListInputBoxID = “devicelist”; bgtWebPrint.getLabelDeviceList (ipAddr,shopID, ListInputBoxID); |