Home

EPSON ePOS-Print API User`s Manual

image

Contents

1. Event Drawer close event ondrawerclosed 157 in firmware Ver 1 2 and later Drawer open event d 158 le cai aad in firmware Ver 1 2 and later 3 Battery OK event tt k 1 eins in firmware Ver 2 2 and later ee Battery low event batteryl 159 AA in firmware Ver 2 2 and later i Constant ASB_ Status Chapter 4 ePOS Print API ePOS Print Builder Object This objects creates a print document for printer control commands that specify strings or graphics to be printed paper cut etc Constructor for an ePOS Print Builder object Creates a new ePOS Print Builder object and initializes it Syntax ePOSBuilder Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder gt lt script gt 65 addTextAlign method Adds the text alignment setting to the command buffer e When using the standard mode specify addTextAlign in Position at the beginning of lines e This API setting is applied to raster image NV logo barcode two dimensional symbol Q e Inthe page mode addTextAlign method specification cannot be used In the page mode use the add TextPosition method to designate the horizontal print position When the page mode is selected for the print mode to set text rotation use the addPageDirection NM metho
2. gt lt script gt 179 align property It sets the position alignment Object type String Description It specifies the position alignment ALIGN_LEFT Default Alignment to the left ALIGN_CENTER Alignment to the center ALIGN_RIGHT Alignment to the right Example Prints with center alignment lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos align epos ALIGN_CENTER epos print canvas gt lt script gt 180 Chapter 5 ePOS Print Canvas API color property It sets printing color Object type String Description It specifies printing color COLOR_NONE No printing COLOR_1 Ist color COLOR_2 2nd color COLOR_3 3rd color COLOR_4 Ath color Example Prints with the 2nd color lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos color epos COLOR_2 epos print canvas gt lt script gt 181 feed prope
3. EPTR_MECHANICAL A mechanical error occurred EPTR_REC_EMPTY No paper in roll paper end sensor EPTR_UNRECOVERABLE An unrecoverable error occurred SchemcError The request document contains a syntax error DeviceNotFouna The printer with the specified device ID does not exist PrintSystemError An error occurred on the printing system EX_BADPORT An error was detected on the communication port EX_TIMEOUT A print timeout occurred 189 190 e Value of satus Constant status ASB_NO_RESPONSE Decription No response from the TM printer ASB_PRINT_SUCCESS Printing is successfully completed ASB_DRAWER_KICK Status of the 3rd pin of the drawer kick out connector H ASB_BATTERY_OFFLINE ASB_OFF_LINE Off line status from remaining battery only for applicable devices in firmware Ver 2 2 and later Offline ASB_COVER_OPEN ASB_PAPER_FEED The cover is open Paper is being fed by a paper feed switch operation ASB_WAIT_ON_LINE Waiting to be brought back online ASB_PANEL_SWITCH The paper feed switch is being pressed ON ASB_MECHANICAL_ERR A mechanical error occurred ASB_AUTOCUTTER_ERR An autocutter error occurred ASB_UNRECOVER_ERR ASB_AUTORECOVER_ERR An unrecoverable error occurred An automatically recoverable error occurred ASB_RECEIPT_NEAR_END ASB_RECEIPT_END No paper in roll paper near end sensor No p
4. Parameter e request Required parameter Object type String Specifies the print document Exception Object type Parameter is invalid Error XMLHttpRequest is not supported Error Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function printHellowWorld var builder new epson ePOSBuilder builder addText Hello World n builder addCut var request builder toString var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onreceive function res alert res success epos onerror function err alert err status epos send request gt lt script gt 139 140 open method Enables status event operation in firmware Ver 1 2 and later Sends the status of the printer specified by the address property using an event Updates the status at the interval specified by the interval property Syntax open Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos oncoveropen function alert coveropen function startMonitor epos open function stopMonitor
5. 0 0 255 0 5 0 256 0 324 serif lt script gt lt head gt lt body gt lt button onclick drawCanvas gt Run lt button gt lt canvas id myCanvas width 512 height 480 gt lt canvas gt lt img id coffee src img coffee jpg alt gt lt img id wmark src img wmark png alt gt lt body gt lt html gt Chapter 3 Programming Guide Prints an Canvas image Content drawn in HTML5 Canvas is printed using the ePOS Print Canvas API Create an ePOS Print Canvas API object using the constructor for the Print method specify the end point address for the printer to be used for printing as well as the canvas content and whether to select paper cut and then print a document For the details about the printer end point address refer to Printer End Point Address p 48 Refer to the following program lt DOCTYPE html gt lt html gt lt head gt lt meta charset utf 8 gt lt title gt TITLE lt title gt lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt function drawCanvas Rendering in HTML5 Canvas lt Obtain the context gt var canvas document getElementById myCanvas var context canvas getContext 2d Transmission of print document Set the end point address var address http 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10
6. 135 136 force property This is the forced transmission mode in firmware Ver 3 0 and later Object type Boolean Description If you enable forced transmission mode print commands are forcibly sent to the printer e Use forced transmission mode when the printer is offline It will result in an error if the printer NH is online The following functions are enabled in forced transmission mode Drawer kick out addPulse method p 121 Stopping the buzzer addSound method p 123 Recovery from errors that can be recovered from addRecovery method p 130 Reset addReset method p 131 Sending commands in real time addCommand method p 132 Example Performs a drawer kick out when the paper is at the end lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder force true builder addPulse gt lt script gt Chapter 4 ePOS Print API message property Command buffer Object type String Description Commands which are usually added by methods of the ePOS Print Builder object can be operated directly from this property for addition or deletion Example To clear the command and reset it to the initial state lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text j
7. Appendix TM P60Il with Peeler Receipt 58mm Receipt 60mm Die cut label Interface Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 420 dots 432 dots 160 dots 400 dots Font Font A Font B Font C For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Font A Line ANK 35 characters ANK 36 characters ANK 33 characters Raster Image Font B ANK 42 characters ANK 43 characters ANK 40 characters Font C ANK 52 characters ANK 54 characters ANK 50 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 10 dots x 24 dots W x H Font C ANK 8 dots x 16 dots W x H Character Font A At the 21st dot from the top of the character Baseline Font B At the 21 st dot from the top of the character Font C At the 15 th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Monochrome image Logo Bar Code Monochrome image UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE339 ITF CODABAR CODE93 CODE128 6S1 128 GS1 DataBar Omnidirectional GS1 DataBar Truncated 6S1 DataBar Limited GS1 DataBar Expanded Two Dimensional Code PDF417 QR Code MaxiCode 6S1 DataBar Stacked 6S1 DataBar Stacked Omnidirectional GS1 DataBar Expanded Stacked Aztec Code DataMatrix Composit Symbology Not supported Ruled Line Not sup
8. Supported 211 80mm 58mm Buzzer Optional Pattern A Pattern E Error No paper Stop Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 212 Appendix TM T88IV 80mm 58mm Interface Ethernet Wireless LAN Resolution 180 dpi x 180 dpi W x H Print Width 512 dots 360 dots Font Font A Font B For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Line Font A ANK 42 characters ANK 30 characters Font B ANK 56 characters ANK 40 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 17 dots W x H Character Baseline Font A At the 21st dot from the top of the character Font B At the 16th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color First color Second color when two color printing is set Page Mode Default Area 512 dots x 831 dots W x H 360 dots x 831 dots W x H when two color printing is set 512 dots x 415 dots W x H 360 dots x 415 dots W x H Page Mode Maximum Area 512 dots x 1662 dots W x H 360 dots x 1662 dots W x H when two color printing is set 512 dots x 831 dots W x H 360 dots x 831 dots W x H Raster image Monochro
9. lt script gt 144 Chapter 4 ePOS Print API status property Status of the printer in firmware Ver 1 2 and later Object type Number Description This is the status last obtained from the printer This is read only Default value O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onoffline function alert epos status Jee epos open gt lt script gt 145 battery property Battery status of the printer Object type Number Description Battery status obtained from the last printer status This is read only Default value O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onbatterylow function alert epos battery epos open gt lt script gt 146 Chapter 4 ePOS Print API timeout property Specifies connection timeout Object type Number Description Specifies connection timeout with ePOS Print supported printer in milliseconds When the transmission of print document by send
10. 29 30 Label issuance ePOS Print API AAAIAACAIIIAAIAIIIAAIAIIAAAAIAIAAAAIIAAIAIAAAAIIICAIAIIAAAAIIAAAAIAAAAAIAAAAIAAAAA 2 Settings d Settings of IP address of ePOS Print supported TM printer T Device ID of the printer to be controlled A Print timeout time d Settings of with or without layout specification in label printing of TM P60ll FEI A 4 Creates print data ePOS Print Builder Object 5 Prints ePOS Print Object Action on the sample program Chapter 2 Sample Program i Operating Environment TM i The system configuration diagram for the sample programs is as below e The figure below also describes an example of IP address settings as network settings Q Inthe sample program Printer to be controlled is not required Refer to it if necessary Web S Wireless eb Server HEHEHE HE Computer to configure the settings 192 168 192 10 Network SEE Printer to be controlled I 192 168 192 21 Terminal l l 192 168 192 XXX I l I l Wireless LAN Router 192 168 192 1 When DHCP is used for the terminal 192 168 192 20 T Web server computer to configure the settings Descriptions here are made assuming that the Web server is the same as the computer to configure the settings 1 Wireless LAN Router 1 TM i 1 set 1 Terminal Terminal with an HTML5 supported Web browser 31 WEE p TM Printer Wireless LAN Model The
11. Description true or 1 Specifies the double sized height false or O default Cancels the double sized height undefined l a Retains the current setting for double sized height When not specified When true or 1 is set for both the dw and dh parameters double width and height characters are Q S printed Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object ype Parameter is invalid Error 75 76 Example To set the size as double width and height lt script type text javascript lt script type text javascript lt function buildMessage builder addTextDouble true gt lt script gt src epos print 3 x x js gt lt script gt gt var builder new epson ePOSBuilder true Chapter 4 ePOS Print API addTextSize method Adds the text scale setting to the command buffer Syntax addTextSize width height Parameter e width Optional parameter Object type Number Specifies the horizontal scale of text Description Integer from 1 to 8 Horizontal scale default 1 undefined f 3 T Retains the current setting for the horizontal scale When not specified e height Optional parameter Object type Number Specifies the vertical scale of text Integer from 1 to 8 Vertical scale default 1 undefined i i Zs Retains the current setting for the verti
12. Example lt script type text javascript lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onpapernearend function alert papernearend Y epos open gt lt script gt src epos print 3 x x js gt lt script gt Chapter 4 ePOS Print API onpaperend event Registers a callback function to obtain a paper end event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onpaperend function alert paperend Y epos open gt lt script gt ondrawerclosed event Registers a callback function to obtain a drawer close event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt gie var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos ondrawerclosed function alert drawerclosed Y epos open gt lt script gt
13. Resolution 180 dpi x 180 dpi W x H Print Width 512 dots 360 dots Font Font A Font B For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Line Font A ANK 42 characters ANK 30 characters Font B ANK 56 characters ANK 40 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 17 dots W x H Character Baseline Font A At the 21st dot from the top of the character Font B At the 16th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area 512 dots x 831 dots W x H 360 dots x 831 dots W x H Page Mode Maximum Area 512 dots x 1662 dots W x H 360 dots x 1662 dots W x H Raster image Monochrome image two color image Logo Monochrome image two color image Bar Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE33 ITF CODABAR CODE93 CODE128 GS1 128 GS1 DataBar Omnidirectional 6S1 DataBar Truncated GS1 DataBar Limited GS1 Databar Expanded Two Dimensional Code Ruled Line PDF417 AR Code MaxiCode 6S1 DataBar Stacked GS1 DataBar Stacked Omnidirectional 6S1 DataBar Expanded Stacked Composite Symbology not supported Not supported Paper Cut Specification of the paper feed position for labels black mark paper Drawer Kick Out Cut Feed cut Not supported
14. builder addBarcode 0001 builder BARCODE_CODE39 builder HRI_BELOW builder addFeedPosition builder NEXT_TOF builder addBarcode 0002 builder BARCODE_CODE39 builder HRI_BELOW builder addFeedPosition builder NEXT_TOF builder addBarcode 0003 builder BARCODE_CODE39 builder HRI_BELOW builder addFeedPosition builder NEXT_TOF gt lt script gt To print tickets with black mark paper lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addFeedPosition builder FEED_CURRENT_TOF builder addBarcode 0001 builder BARCODE_CODE39 builder HRI_BELOW builder addFeedPosition builder FEED_CUTTING builder addCut builder CUT_NO_FEED gt lt script gt 85 addFeed method Adds a line feed to the command buffer Syntax addFeed Return value Object type ePOS Print Builder Object ePOS Builder Example To start a new line after printing a character string lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addText Hello addFeed builder addText World addFeed gt lt script gt Chapter 4 ePOS Pr
15. ePOS Print Canvas API No 012301 Sample Shop Expires Mon Aug 01 2011 Sample Shop 16 27 24 27 28 Program Flow From its initial display state up to print job completion the sample program flows as below Queue ticket number issuance ePOS Print API DDD DD DEED DPD PDD LODE NDEI DEPP EDD DEES DD PE DEDEDE DEP DEEP DP DE DOO E DE DEED E EMEP IND DD EPP E DEPEND DD 7 A 1 Open the sample program Web page i lea c arar crrraccrrarcrracrrrarcrircrrrarcrircragporiarcrrarcrircrrccrrorrrccraresra ss aaa Iris Ud id E H 4 2 Settings H d Settings of IP address of ePOS Print supported TM printer A a A 3 Device ID of the printer to be controlled i f ENR 1 Print timeout time A 2 Ba ass hee UPA O 3 Click Queue Ticket rar H 4 Creates print data ePOS Print Builder Object 5 Prints ePOS Print Object E Action on the sample program ES Action on the customer A A EEE EEE EEE A e Chapter 2 Sample Program Coupon issuance ePOS Print Canvas API EE EEE TEETER eed E E E E E E E E E E E E E E E E E E E E E E E E E A AAA 2 Settings 1 Settings of IP address of ePOS Print supported TM printer 1 Device ID of the printer to be used for printing A Print timeout time y 4 Render in HTIMLS Canvas 5 Prints ePOS Print Canvas API Object EA Action on the sample program prrrrrrzzzzzzzzz Action on the customer
16. in firmware Ver 1 2 and later Object type String Description The URL of the printer to be used for printing is specified The URL is shown as follows http IP address of ePOS Print supported TM printer cgi bin epos service cgi devid device ID of printer to be used for printing 8timeout timeout time The default value is the address specified by the constructor Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var epos new epson CanvasPrint epos address http 192 168 192 168 cgi bin epos service cgi devid local_printer epos oncoveropen function alert coveropen epos open gt lt script gt 170 Chapter 5 ePOS Print Canvas API enabled property Retains the enabled disabled setting for status event operation in firmware Ver 1 2 and later Object type Boolean Description The enabled disabled setting for status event operation is retained using a logical value This is read only The default value is false Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos oncoveropen function alert coveropen epos open alert epos enabl
17. lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addLayout builder LAYOUT_RECEIPT 580 gt lt script gt To set 58mm receipt with black mark lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addLayout builder LAYOUT_RECEIPT_BM 580 0 15 0 gt lt script gt To set 58mm die cut label without black mark lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addLayout builder LAYOUT_LABEL 580 0 15 15 25 gt lt script gt To set 58mm die cut label with black mark lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addLayout builder LAYOUT_LABEL_ BM 580 0 15 15 25 gt lt script gt 15 129 130 addRecovery method Adds the recovery from errors to the command buffer in firmware Ver 3 0 and later Enable forced trans
18. 157 158 ondraweropen event Registers a callback function to obtain a drawer open event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos ondraweropen function alert draweropen Y epos open gt lt script gt src epos print 3 x x js gt lt script gt onbatteryok event Registers call back function and obtains remaining battery event in firmware Ver 2 2 and later Object type Function Example lt script type text javascript lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onbatteryok function alert batteryok Y epos open gt lt script gt src epos print 3 x x js gt lt script gt Chapter 4 ePOS Print API onbatterylow event Registers call back function and obtains no remaining battery event in firmware Ver 2 2 and later Object type Function O Example lt script type text javascript lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSP
19. Matsumoto Nagano Your Number Printing text in the double sized width style Scale x 6 horizontal and x 4 vertical Alignment Center Please wait until your ticket number is called Mon Aug 01 2011 16 18 00 1 Printing a Barcode 0 000 13 ePOS Print Canvas API No 012301 Enjoy FREE Coffee Expires Mon Aug 01 2011 16 27 24 Monochrome or Grayscale Monochrome Chapter 1 Overview lt Web Server gt lt Printers that can be Web controlled gt Application Wireless LAN lt Web Browser gt 7 Wireless ble Trol lt ePOS Print supported TM printer gt A Web application is placed A Web browser displays the Web application The Web browser sends print data For an ePOS Print supported printer the print data for the unit printer is printed For a IM i the print data is sent to a controllable printer The data is printed from printers that can be controlled oan kh WN The ePOS Print supported TM printer returns a resoonse document to the terminal 15 16 The installed functions vary depending on the model For details refer to Appendix Printer Q Specifications Printing functions of ePOS Print API ODC COCO O wv a OCOC COOU OU O O O Print setting alignment line feed space text rotation page mode Character data setting language font device font double sizing sca
20. OK IP address of ePOS Print supported printer 1192 168 192 168 Device ID of the target printer local_printer Print timeout milliseconds 60000 Print in grayscale Coupon Only for supported models Set the paper layout Label Only for TM P60II IP address of the intelligent printer OK Cancel Description Specifies the IP address of the ePOS Print supported TM printer Default value TM i DHCP If an address fails to be assigned via DHCP the value becomes 192 168 192 168 TM Printer 192 168 192 168 Device ID of the target printer Specifies the Device ID of the printer to print queue ticket numbers and coupons Default value local_printer Print timeout millisecond Specifies the timeout time default 60000 Print in grayscale Coupon Only for supported models Prints coupons in gray scale Default No Set the paper layout Label Only for TM P60I Prints labels with specified layout Default No Chapter 3 Programming Guide Programming Guide This chapter describes how to write programs in the application development using ePOS Print ePOS Print API Print Mode There are two types of print modes standard and page modes Standard mode In standard mode characters are printed line by line The line feed space is adjusted based on the font size and the height of images barcodes etc This mode is suitable for the type of prin
21. gt lt script gt 89 90 addBarcode method Adds barcode printing to the command buffer In page mode a barcode is laid out in the current print position with the reference point being its QY bottom left dot except for HRI Syntax addBarcode data hri font width height Parameter e data Required parameter Object type String Specifies the barcode data as a string Barcode type UPC A Description When an 11 digit number is specified a check digit is automatically added When a 12 digit number is specified the 12th digit is pro cessed as a check digit but the check digit is not vali dated UPC E EAN13 JAN13 Specify 0 as the first digit Specify the manufacturer code in the digits 2 to 6 Specify right align the item code in the digits 7 to 11 The number of item code digits varies depending on the manufacturer code Specify Os in empty digits When an 11 digit number is specified a check digit is automatically added When a 12 digit number is specified the 12th digit is pro cessed as a check digit but the check digit is not vali dated When an 12 digit number is specified a check digit is automatically added When a 13 digit number is specified the 12th digit is pro cessed as a check digit but the check digit is not vali dated EAN8 JAN8 When a 7 digit number is specified a check digit is auto matically added When an 8 digit number i
22. text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextFont builder FONT_B gt lt script gt 73 addTextSmooth method Adds the smoothing setting to the command buffer Syntax addTextSmooth smooth Parameter e smooth Required parameter Object type Boolean Specifies whether to enable smoothing true or 1 Specifies smoothing false or O default Cancels smoothing Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error Example To enable smoothing lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addText Smooth true 1 aie lt script gt Chapter 4 ePOS Print API addTextDouble method Adds the double sized text setting to the command buffer Syntax addTextDouble dw dh Parameter e dw Optional parameter Object type Boolean Specifies the double sized width Description true or 1 Specifies the double sized width false or O default Cancels the double sized width undefined Retains the current setting for double sized width When not specified e dh Optional parameter Object type Boolean Specifies the double sized height
23. 30 dots and print the characters ABCDE lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addPageArea 100 50 200 30 builder addText ABCDE builder addPageEnd gt lt script gt 110 Chapter 4 ePOS Print API addPageDirection method Adds the page mode print direction setting to the command buffer Specifies the print direction in page mode This function can be omitted if rotation is not required Q Use this API function by inserting it between addPageBegin p 107 and PageEnd p 108 Syntax addPageDirection dir Parameter e dir Required parameter Object type String Specifies the print direction in page mode Constant Left to right DIRECTION_LEFT_TO_RIGHT default No rotation Data is printed from the top left corner to the right Bottom to top Counterclockwise rotation by 90 degrees Data is printed from the bottom left corner to the top Right to left DIRECTION_RIGHT_TO_LEFT Rotation by 180 degrees Data is printed from the bottom right corner to the left DIRECTION_BOTTOM_TO_TOP Top to bottom Clockwise rotation by 90 degrees Data is printed from the top right corner to the bottom DIRECTION_TOP_TO_BOTTOM Return value Return value
24. 384 dots x 831 dots WxH 512 dots x 831 dots WxH when two color printing is set 360 dots x 415 dots WxH 384 dots x 415 dots WxH 512 dots x 415 dots WxH 227 Page Mode Maximum Area when two color printing is set 58mm 360 dots x 1662 dots W x H 60mm 384 dots x 1662 dots W x H 80mm 512 dots x 1662 dots W x H 360 dots x 831 dots W x H 384 dots x 831 dots WxH 512 dots x 831 dots WxH Page Mode Line Not supported Rectangle Specification of the paper feed position for labels black mark Not supported paper Paper Cut Cut Feed cut Drawer Kick Out Supported Buzzer Supported via Drawer Kick Out Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 228 Appendix TM P60Ill Receipt 58mm Receipt 60mm Interface Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 420 dots 432 dots Font Font A Font B Font C For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Font A ANK 35 characters ANK 36 characters Line Font B ANK 42 characters ANK 43 characters Font C ANK 52 characters ANK 54 characters Character Size Font A ANK 12 dots x 24 dots W x H Font
25. 42 Embedding of CPOS PHARAP I nts cionado ar dare 43 Print DOCUMENT Crea on ayze inete nar a a aie aia i eisietmant a T E RT 44 Transmission Of Print Documenta olla balas 48 Reception of PATRON E 49 RECSDTOMOFSTGTUS EVEN riada a da ld ax 51 E ePOS Print Canvas APh soceri iii AAEE R O a de 52 Embedding of ePOS Print Canvas API tkanka nn rara rr ren 53 Rendering in HIML5 CANVOS ss sssssssrisskiaskitntan akant A nnan AnA KANAAEANAEANNAENNAEANAEENEAKANAKENNAEENEEENNEENNEEENEEEEEEEENEEEE NAE 54 Prints an Canvas image ansia a aa hdd a Taaa a Eea E A a Vets aa aa aa 55 KT NS 56 Receplion of STATUS EVE Rias a Ai A CE laa a el 58 ePOS Print API caian 59 EEB Ena e a iaa s 59 window epson ePOSBuilder COMpONeNTS ccccooccnccccionnnonnnononnnnnnnnnonononnononn nn nroronnn rr nro nonn nr nnrrnconnrnncnn ns 59 window epson ePOSPrint COMPONENTS occcocccccoonnnnncnnonanononononannnnononn nro nrrnnnn o nr ro ronon ono rrnnnnn nr nr rrronnrnncnn ns 63 E ePOS Print Builder Object oooooooocccononionccccnncccononcncnnnonanonnncnnnnnnnnnnnnnnnannnnnnnnnnnnnnnrrrnnnannanennos 65 COMSITUCTOR mint add tdetdbiatdn ia 65 AddlextAlign MENOG sitet seeders a e a A panini nono ia i anaes 66 adaTextlinespace melodico tad 67 adalextRotate MEIN aaea a dupe eat aust foi 68 NAT 69 GACTSXTLONG MEMO iii oia 70 adalextront method mucosidad 73 CAAGISXTSMOOIMMETNO sia 74 add TexiDouble methodi iasa a anti a i 75 addlexSize Method adn 77 adalet Semed rania
26. ANK 72 characters ANK 70 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 10 dots x 24 dots W x H Font C ANK 8 dots x 16 dots W x H Character Font A At the 21st dot from the top of the character Baseline Font B At the 21 st dot from the top of the character Font C At the 15 st dot from the top of the character Default Line Feed Space 30 dots Color Specification First color First color Second color when two color printing is set Raster Image Monochrome image Two color image Logo Monochrome image Two color image To perform two color printing change the settings of the printer using the memory switch setting utility Bar Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE89 ITF CODABAR CODE93 CODE128 Two Dimensional Code PDF417 QR Code MaxiCode Ruled Line Not supported 225 Receipt Die cut label Page Mode Default Area 576 dots x 738 dots W x H 560 dots x 738 dots W x H when two 576 dots x 369 dots W x H 560 dots x 369 dots W x H color printing is set Page Mode Maximum Area 576 dots x 1476 dots W x H 560 dots x 1476 dots W x H when two 576 dots x 738 dots W x H 560 dots x 738 dots W x H color printing is set Page Mode Line Not supported Rectangle Paper Cut Cut Feed cut Specification of the paper feed position for labels black mark Supported paper Drawer Kick Out Supported Buzzer Not supporte
27. Canvas API Prints labels 3 Label This is a sample program using the ePOS Print API 25 26 CAE o PA EA 4 Settings IP address of ePOS Print supported printer 1192 168 192 168 Device ID of the target printer local_printer Print timeout milliseconds 60000 Print in grayscale Coupon Only for supported models Set the paper layout Label Only for TM P60I OK Cancel Displays the Settings screen The screen is used to set the following e IP adress of the ePOS Print supported TM printer Default TM i DHCP If an address fails to be assigned via DHCP the value becomes 192 168 192 168 TM Printer 192 168 192 168 e Device ID of the target printer Default local_printer e Print timeout milliseconds Default 60000 e Prints coupons in gray scale Coupon in firmware Ver 1 2 and later Default No e Prints labels with specified layout Label in firmware Ver 3 0 and later Default No Chapter 2 Sample Program Print Image The sample program prints the following Your Number ePOS Print API S Matsumoto Nagano Your Number 0001 Please wait until your ticket number is cal led Mon Aug 01 2011 16 18 00 IN Label ePOS Print API Name ten A Color Red Code EMINENTNI 2012001 Die cut label mount width 58mm or above Label size width 54 mm x height 25 4 mm or above Coupon
28. Canvas into raster image data according to the settings of the halftone and brightness properties One pixel in an image equals to one printer dot When an image contains any transparent color the background color of the image is assumed to be white If an HTML5 Canvas image contains images downloaded from different domains you cannot NM print the image In this case a security error occurs due to violation of the same origin policy of JavaScript Syntax A print canvas 2 print canvas cut mode N 2 is the syntax of compatible version It is recommended to use the syntax of 1 Parameter e canvas Required parameter Object type canvas Specify the HTML5 Canvas object to be printed e cut Optional parameter Object type Boolean Sets whether to cut paper true or 1 Cuts the paper after printing false or O Does not cut the paper after printing undefined Does not cut the paper after printing e mode Optional parameter Object type String Specifies the color mode in firmware Ver 1 2 and later Decription MODE_MONO Monochrome two tone MODE_GRAY16 Multiple tones 16 tone undefined Monochrome two tone Exception Object type Parameter is invalid Error XMLHttpRequest is not supported Error Canvas is not supported Error 165 166 Example To print Canvas ID myCanvas lt script type text javascript src epos print 3 x x js
29. Draw button The image is drawn on Canvas on the left of the page according to the settings made on the right of the page 243 4 Set the following and click the Print button A A AA IE URL Enter the following URL http IP address of ePOS Print supported TM printen cgi bin epos service cgi devid device ID of printer to be used for printing amp timeout timeout time Mode Set the color mode Monochrome Grayscale Brightness Adjust the brightness Gamma value in the range 0 1 10 0 Halftone Set the halftone processing method for monochrome printing two tone Cut Paper When this item is selected feed cut is performed after printing Alignment Specify the printing position alignment Color Monochrome Specify the printing color in 2 tone 5 The print result is displayed 0 244 Appendix Rendering Handwritten Images canvas print hand html Draw a handwritten image and perform a test print o x n 7 Canvas Handwriting Pen 2 O Thin Medium Thick Test Print URL http 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Mode Monochrome y Brightness 1 0 Halftone Monochrome Threshold Alignment Let y Color Monochrome Color 1 Cut Paper L d A Open the following URL page using the Web browser http Web server IP add
30. Name Status Object type Number Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onstatuschange function status alert status Y epos open gt lt script gt 152 Chapter 4 ePOS Print API onbatterystatuschange event Registers call back function and obtains battery status change event in firmware Ver 2 2 and later Object type Function battery Parameter of the callback function Parameters battery Name Batterystatus Object type Number Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onbatterystatuschange function battery alert battery Y epos open gt lt script gt ononline event Registers a callback function to obtain a online event in firmware Ver 1 2 and later Object type Function Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer
31. Red Code PULL 2012001 Die cut label mount width 58mm or above Label size width 54 mm x height 25 4 mm or above 252 Coupon ePOS Print Canvas API Enjoy No 012301 FREE Coffee Expires Mon Aug 01 2011 16 27 24 II Appendix Environment of Sample Program The environment of sample program is shown below AA A A Development environment Microsoft Visual Studio 2012 example Required than Windows 8 Sample program file name win8 ePOS Print Demo zip Environment setting Procedure A Configure your computer and ePOS Print supported TM printer so that they can connect to the network Uncompress the sample program into any folder Open the sample program solution file using Visual Studio Start debugging A OQ N 253 Sample Program Settings Settings Printer ePOS Print API ePOS Print Canvas API Printer Sets the target printer and printing options Device ID of the target printer local_printer Print timeout milliseconds 60000 The screen is used to set the following Description Specifies the IP address of the ePOS Print supported printer Default value TM i DHCP If an address fails to be assigned via DHCP the value becomes 192 168 192 168 TM Printer 192 168 192 168 Specifies the Device ID of the printer to print queue ticket numbers and coupons Default value local_printer Print timeout milliseconds
32. address var address http 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Create an ePOS Print Canvas API object var epos new epson CanvasPrint address Set an event callback function cover open epos oncoveropen function alert coveropen Jez Set an event callback function paper near end epos onpapernearend function alert papernearend Jer Enable status event operation epos open Chapter 4 ePOS Print API ePOS Print API This chapter describes the ePOS Print API List of API functions ePOS Print provides the following objects d ePOS Print Builder window epson ePOSBuilder Object p 59 d ePOS Print window epson ePOSPrint Object p 63 window epson ePOSBuilder Components stan age Pa API Description dard pag mode ge mode Constructor ePOS Builder males an ePOS Print XML Builder e O 65 object Method action eee a tag for the text alignment g 66 setting addtText Adds a tag for the line feed space i O O 67 LineSpace setting addTextRotate ACOE a tag for the text rotation set O g 68 ting addText Adds a tag for printing text O O 69 Ee oles a tag for the target language O O 70 setting addTextFont Adds a tag for the text font setting O 73 Text E Ses a tag for the text smoothing O O 74 setting addTextDouble AS a tag for specifying the dou o 75 ble sized text
33. bin epos service cgi devid device ID of printer to be used for printing amp timeout timeout time Mode Set the color mode Monochrome Grayscale Brightness Adjust the brightness Gamma value in the range 0 1 10 0 Halftone Set the halftone processing method for monochrome printing two tone Cut Paper When this item is selected feed cut is performed after printing Alignment Specify the printing position alignment Color Monochrome Specify the printing color in 2 tone The print result is displayed Appendix Rendering Images canvas print image html Draw an image in HTML5 Canvas and perform a test print r cE 1 E i mamira P X 8 EPSON epos Print Sample lu AE Canvas Image Editing Sample Shop 2 Matsumoto Nagano de Position ty ES x 100 y0 on CN A Ye w 200 h70 vo o Angle clockwise rotation with upper left origin 0 degree s Image File in the same server logo1 bmp Draw 3 Clear Reset Test Print 4 URL http 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Property Mode Monochrome Brightness 1 0 Halftone Monochrome Dither z Print Alignment Let Color Monochrome Color 1 w Y Cut Paper A Open the following URL page using the Web browser http Web server IP address canvas canvas
34. encode the string Truncated PDF417 The data area can contain up to 928 code words in a maximum of 90 rows each of which can contain up to 30 code words QR Code Model 1 Convert the character string to the string in Shift JIS apply the escape sequence and then encode the string based on the data type as shown below Number Oto9 QR Code Model 2 Alphanumeric character Oto9 AtoZ space 4 Kanji character Shift JIS value 8 bit byte data Ox00 to Oxff 95 96 2D Code iype MaxiCode Mode 2 MaxiCode Mode 3 MaxiCode Mode 4 MaxiCode Mode 5 MaxiCode Mode 6 Convert the character string to the string in UTF 8 apply the escape sequence and then encode the string In Modes 2 and 3 when the first piece of data is 0 gt 1 x1e011x1dyy where yy is a two digit num ben this is processed as the message header and the subsequent data is processed as the primary message In other cases from the first piece of data data is processed as the primary message In Mode 2 specify the primary message in the following format Postal code 1 to 9 digit number GS x1d ISO country code 1 to 3 digit number GS x1d Service class code 1 to 3 digit number In Mode 3 specify the primary message in the following format Postal code 1 to 6 pieces of data convertible by Code Set A GS x1d ISO country code 1 to 3 digit number GS x1d Service class code Cl to 3
35. epos close gt lt script gt Chapter 4 ePOS Print API close method Disables status event operation in firmware Ver 1 2 and later Syntax close Example lt script type text javascript lt script type text javascript gt lt var address var epos epos oncoveropen function alert coveropen di http 192 168 function startMonitor epos open function stopMonitor epos close gt lt script gt 192 168 cgi bin epos service cgi devid local_printer new epson ePOSPrint address src epos print 3 x x js gt lt script gt yA 141 142 address property URL of the printer in firmware Ver 1 2 and later Object type String Description The URL of the printer to be used for printing is specified The URL is shown as follows http IP address of ePOS Print supported TM printer cgi bin epos service cgi devid device ID of printer to be used for printing 8timeout timeout time The default value is the address specified by the constructor Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var epos new epson ePOSPrint epos address http 192 168 192 168 cgi bin epos service cgi devid local_printer epos oncoveropen function alert coveropen epos open gt lt script g
36. evaluation About this Manual Aim of the Manual This manual is intended to provide development engineers with all the information necessary for building designing an ePOS Print API system or developing designing an ePOS Print printer application In this manual ePOS Print supported printer is a generic term for the TM i series and TM printers that support the ePOS Print API The TM i series in this manual is a generic term for the following printers e TM T88V i e TM T70 i e TM L90 i Manual Content The manual is made up of the following sections Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Appendix Overview Sample Program Programming Guide ePOS Print API ePOS Print Canvas API ePOS Print Editor Printer specifications Paper setting function of TM L90 Rendering in HTMLS Canvas Windows Store Apps Contents MB FOr SGiely icc A eee ie a Aa A aes Ne AN AN AR 3 key to Symbolen A ida 3 E ReStrictiOn Of USe ccoo ide 3 Eee this Manual E E A A A A E eae 4 Aim or the Manli a EEE e E Aa es 4 MUISE KEENE nE A E E TE T 4 E COntentS a a a a A Be ees 5 OVOIVIOW aero E E EE E 11 E Overview of ePOS Pri iio iii bas 11 EM ia A alia A vind a ad O ovals 12 PIN EMP iva oath ee 13 A AN 15 A r seuss cuied beecstunane sopsitetdseasedracas Vadet sahedanoatduseSanedehsauipdipsaegise casei 16 E Operating Environ Met ccccececeeeeeeeeeeeeeeeeceeeeeeeeeeeeeeeeesesaeseseeeeeseeaeeeeeeeeeeeeeeee
37. gt lt script gt lt script type text javascript gt lt function printCanvas var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos onreceive function res alert res success epos onerror function err alert err status epos print canvas gt lt script gt Chapter 5 ePOS Print Canvas API open method Enables status event operation in firmware Ver 1 2 and later Sends the status of the printer specified by the address property using an event Updates the status at the interval specified by the interval property Syntax open Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos oncoveropen function alert coveropen di function startMonitor epos open function stopMonitor epos close gt lt script gt 167 close method Disables status event operation in firmware Ver 1 2 and later Syntax close Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address h
38. in the menu area to add an element in the edit area The position of the added function can be changed by dragging 2 Configure the added element Example When the NV logo is added set the key code 3 Select the Preview tab to check the preview image When a printer is connected you can also check the image by printing For details refer to Print 0 207 MN DE mibienn O X 8 epos Print Editor P J ni Edit Preview API XML Print Setting Sample Shop Thank you Orange Mineral water Total 1 000 e Logo printing barcode printing 2D code printing ESC command buzzer sound drawer kick Q and paper cut are displayed as icons e The layout may change depending on the preview settings For details refer to Setting p 203 205 4 Select the API tab The ePOS Print API sample code appears Use it by copying cam Go Limia O CX e ePOS Print Editor Edit Preview API XML Print Setting ePOS Print API Sample Code var canvas document getElementById canvas var address http 192 168 11 100 cgi bin epos service cgi devid local_printer amp timeout 60000 var builder new epson ePOSBuilder builder addTextAlign builder ALIGN_CENTER builder brightness 1 0 builder halftone builder HALFTONE_ERROR_DIFFUSION builder addImage canvas getContext 2d 0 0 canvas width canvas height builder COLOR_1 bu
39. javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextLang ko gt lt script gt 71 72 To set the language as Simplified Chinese lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextLang zh hans gt lt script gt To set the language as Traditional Chinese lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextLang zh hant gt lt script gt Chapter 4 ePOS Print API addTextFont method Adds the text font setting to the command buffer Syntax addTextFont font Parameter e font Required parameter Object type String Specifies the font Constant on FONT_A default Font A FONT_B Font B FONT_C Font C Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object ype Parameter is invalid Error Example To set the font B lt script type text javascript src epos print 3 x x js gt lt script gt lt script type
40. lt function buildMessage var builder new epson ePOSBuilder builder addTextLineSpace 30 gt lt script gt 67 68 addTextRotate method Adds the text rotation setting to the command buffer e This API setting also applies to barcodes two dimensional symbols Q e When using the standard mode specify addTextAlign in Position at the beginning of lines e Inthe page mode addTextAlign method specification cannot be used When the page mode is selected for the print mode to set text rotation use the addPageDirection AN method p 111 instead of this API function Syntax addTextRotate rotate Parameter e rotate Required parameter Object type Boolean Specifies whether to rotate text ee eee A true or 11 Specifies rotated printing of text false or O default Cancels rotated printing of text Return value Object ype ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example To set text rotation lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextRotate true gt lt script gt Chapter 4 ePOS Print API addText method Adas the printing of text to the command buffer 2 After
41. lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt Sis var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onstatuschange function status alert status Y epos open gt lt script gt 193 onbatterystatuschange event Registers call back function and obtains battery status change event in firmware Ver 2 2 and later Syntax Function battery Parameter of the callback function Parameters battery Name Battery status Object type Number Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onbatterystatuschange function battery alert battery y epos open gt lt script gt 194 Chapter 5 ePOS Print Canvas API onbatteryok event Registers call back function and obtains remaining battery event in firmware Ver 2 2 and later Syntax Function Example lt script type text javascript lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onbatteryok fun
42. method times out onerror even is generated Default value 300000 5 minutes Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var builder new epson ePOSBuilder builder addText Hello World n builder addCut var request builder toString var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos timeout 60000 epos onreceive function res alert res success epos onerror function err alert err status epos send request gt lt script gt 147 148 onreceive event This property registers the callback function and obtains a response message receipt event Syntax Function response Parameter of the callback function Parameters response See Properties of the response object on page 148 Name Response message Object type Object Properties of the response object Pope TT success p 148 Print result Boolean code p 148 Error code String status p 149 Status Number battery p 150 Battery status Number e Value of success true or 1 Printing succeeded false or O Printing failed e Value of code EPTR_AUTOMATICAL An automatically recoverable error occurred EPTR_COVER_OPEN A cover open error occurre
43. ondraweropen function alert draweropen Y epos open gt lt script gt 200 Chapter 6 ePOS Print Editor ePOS Print Editor This section describes how to use ePOS Print Editor included in the contents in the package This tool allows you to create an ePOS Print API p 59 sample code as you like Use this tool for your Web application development ePOS Print Editor Operating Environment T Web Browser e Windows Internet Explorer 9 or later e Mozilla Firefox 13 or later e Google Chrome 19 or later e Apple Safari 5 1 7 or later e Pad Safari in iOS 5 1 or later 201 Displaying ePOS Print Editor of ePOS Editor to a folder under Web server DOM Exception 18 error occurs error occurs e If opening a page with ePOS Print Editor s HTML file placed on the local disk some NM functionality does not operate due to your Web browser s security policy Place the HTML file In Google Chrome when a preview image including pictures is displayed a SECURITY_ERR e In Windows Internet Explorer 9 when printing is performed a SCRIPT5 Access is denied Open the following URL page using the Web browser http Web server IP address editor index html 2 ePOS Print Editor appears lol POD a Paper Feed naag ll JN JA oe TE saa i a 2 amp x S epos print Editor iy ae fod Edit Preview API XML Print Setting Common Text Printer Font Fl F
44. printing text to print content other than text execute line feed or paper feed In page mode characters are laid out in the current print position with the reference point being AN the character baseline dot Printer specifications p 209 Syntax addText data Parameter e data Required parameter Object type String Specify a character string to be printed For the horizontal tab line feed use the following escape sequences AAA a ee es t Horizontal tab HT n Line feed LF Carriage return Return valueReturn value Return value Object type ePOS Print Builder Object ePOS Builder 4 Exception Object ye Parameter is invalid Error Example To add character strings lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addText Hello t addText Worldin gt lt script gt 69 70 addTextLang method Adds the language setting to the command buffer Syntax addTextLang lang Parameter e lang Required parameter Object type String Specifies the target language Language en default English ANK de German ANK fr French ANK it Italian ANK es Spanish ANK Japanese Je International character set changes to Jap
45. result of accident misuse or abuse of this product or unauthorized modifications repairs or alterations to this product or excluding the U S failure to strictly comply with Seiko Epson Corporation s operating and maintenance instructions e Seiko Epson Corporation shall not be liable against any damages or problems arising from the use of any options or any consumable products other than those designated as Original EPSON Products or EPSON Approved Products by Seiko Epson Corporation Trademarks EPSON and ESC POS are registered trademarks of Seiko Epson Corporation in the U S and other countries Windows and Internet Explorer are either registered trademarks or trademarks of Microsoft Corpora tion in the United States and other countries Safari and TrueType are either registered trademarks or trademarks of Apple Inc in the United States and other countries Android and Google Chrome United States and other countries are either registered trademarks or trademarks of Google Inc in the Mozilla and Firefox are either registered trademarks or trademarks of Mozilla Foundation in the United States and other countries OS is registered trademarks or trademarks of Cisco in the United States and other countries ESC POS Command System EPSON has been taking industry s initiatives with its own POS printer command system ESC POS ESC POS has a large number of commands including patented ones
46. system configuration diagram for the sample programs is as below 2 e The figure below also describes an example of IP address settings as network settings Web Server Computer to configure the settings Wireless 192 168 192 10 HEHEHE H Network gt Ss Printer to be controlled 192 168 192 21 LEA E E J PRERA J Wireless LAN Router Terminal 192 168 192 1 192 168 192 XXX TM P60ll lt TM Printer Wireless LAN Model gt 192 168 192 20 1 Web server computer to configure the settings Descriptions here are made assuming that the Web server is the same as the computer to configure the settings 1 Wireless LAN Router 1 TM Printer Wireless LAN Model 1 set TM P60ll A Terminal Terminal with an HTML5 supported Web browser 32 Chapter 2 Sample Program Environment Settings A flow for configuring the environment settings for the sample program is shown as follows 1 Router Settings Configure the settings such as SSID IP address DHCP and allocated IP address For details refer to the manual for the device you are using 2 Computer Settings 1 Network Settings Configure the network settings for the computer such as IP address 2 Web Server Configuration Configure a Web server on the computer 3 Registration of Sample Program ePOS Print_API_UM_E_Sample zip p 34 4 Terminal settings Configure the wireless LAN Wi Fi se
47. the barcode 106 or above Aztec Code Ignored DataMatrix Others Ignored Return value Return value 0 11 41913 ePOS Print Builder Object ePOS Builder Exception pect ype Parameter is invalid Error 99 Example To print two dimensional symbols 100 lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addSymbol ABCDE builder SYMBOL_PDF417_STANDARD builder addSymbol ABCDE builder SYMBOL_QRCODE_MODEL 2 builder LEVEL_Q builder addSymbol 908063840 x1d850 x1d001 x1d x04 builder SYMBOL_MAXICODE_MODE_2 builder addSymbol 0201234567890 builder SYMBOL_ GS1_DATABAR STACKED builder addSymbol 0201234567890 builder SYMBOL_GS1 DATABAR STACKED OMNIDIRECTIONAL builder addSymbol 01 02012345678903 builder SYMBOL_GS1 DATABAR EXPANDED STACKED builder addSymbol ABCDE builder SYMBOL_AZTECCODE_FULLRANGE builder addSymbol ABCDE builder SYMBOL DATAMATRIX SQUARE gt lt script gt 23 Chapter 4 ePOS Print API addHLine method Adds horizontal line printing to the command buffer Draws horizontal lines Not available in page mode Syntax addHLline x1 x2 style Parameter e xl Required parameter Object type Number Specifies the start p
48. the printer to be controlled IP Address Specifies the IP address of the printer to be controlled Retry Interval ms Specifies the interval of retry toward the printer to be controlled in milliseconds Information on the registered devices is displayed in Device List Click Test Print for each registered printer to check that it operates correctly TM Printer for Wireless LAN Model Configure the settings according to the following procedure 1 2 3 4 Turn on the printer Start the Web browser and type the IP address of the TM printer into the address bar EpsonNet Config Web version is launched Select Configuration ePOS Print Set device ID Chapter 2 Sample Program Sample Program Settings Configure the settings for the sample program according to the procedure below Q In the sample program Device ID Settings are not required Refer to it if necessary Start the Web server Connect all the printers to the network and turn their power ON Open the following URL page using the Web browser http Web server IP address sample index html h WON The sample program page opens Click Settings F aus Fa SSA m a om ome O CX E ePos Print x th ke iy ue fof ePOS Print Demo Queue Ticket Coupon Label Settings 39 40 5 The Settings screen appears Specify the following and click
49. their end is specified by addVLineEnd p 105 Use this API function with addVLineEnd Syntax addVLineBegin x style Parameter e x Required parameter Object type Number Specifies the start position of the vertical line in dots Specifies an integer from 0 to 65535 e style Optional parameter Object type String Specifies the line type LINE_THIN Solid line Thin LINE_MEDIUM Solid line Medium LINE_THICK Solid line Thick LINE_THIN_DOUBLE Double line Thin LINE_MEDIUM_DOUBLE Double line Medium LINE_THICK_DOUBLE Double line Thick undefined When not specified Solid line Thin Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception SN Parameter is invalid Error 103 Example To draw thin vertical lines at 100 dots and 200 dots from the left end lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addVLineBegin 100 addVLineBegin 200 builder addFeedUnit 100 builder addVLineEnd 100 addVLineEnd 200 gt lt script gt 104 Chapter 4 ePOS Print API addVLineEnd method Adds the end of vertical line to the command buffer Finishes drawing vertical lines Not available in page mode Q Use this API function with addVLineBeg
50. 000 Create an ePOS Print Canvas API object var epos new epson CanvasPrint address Print epos cut true epos print canvas lt script gt lt head gt lt body gt lt button onclick drawCanvas gt Run lt button gt lt canvas id myCanvas width 512 height 480 gt lt canvas gt lt img id coffee src img coffee jpg alt gt lt img id wmark src img wmark png alt gt lt body gt lt html gt 2 For the details about the printer end point address refer to Printer End Point Address p 48 55 Reception of Print Result The print result can be received by setting a callback function using the onreceive property p 148 of the ePOS Print Canvas API object The following information is obtained 1 Print result J Error code 1 Printer Status Q The printer status can be obtained when communication with the printer is possible Refer to the following program For the details about how to program a callback function in detail refer to Error handling p 50 lt DOCTYPE html gt lt html gt lt head gt lt meta charset utf 8 gt lt title gt TITLE lt title gt lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt function drawCanvas Rendering in HTML5 Canvas lt Obtain the context gt var canvas document getElementBylId myCanvas var context canvas ge
51. 1 2 and later 1 The scan quality of barcodes two dimensional symbols printed as multiple tone raster images cannot be guaranteed Print them as two tone images in firmware Ver 1 2 and later 1 If printing was cancelled perform the following settings to clear the data left in the printer in Ver 3 0 and later e In the printer DIP switches memory switches configure the Busy condition only for the receive buffer full e Disable the command execution offline TM P 0ll Chapter 2 Sample Program sample Program This chapter describes how to use the sample program e In this chapter descriptions are made based on a system configuration using a Web server Q e Descriptions are made assuming that the Web server in this chapter is a Web server configured by using IIS Microsoft Internet Information Services If your Web server is used in a different environment interpret the descriptions accordingly sample Program System Overview Sample Program Screen The screen compositions for the sample program are as follows Je a a mill 9 gt Ox E epos print al fy ve fs ePOS Print Demo 1 Queue Ticket 2 Coupon 3457 Label 4 Settings A E Prints queue ticket numbers 1 Queue Ticket o This is a sample program using the ePOS Print API Prints coupons 2 Coupon This is a sample program using the ePOS Print
52. 201 E Displaying ePOS Print EditOF cccononccccnnnoccccccconononocnncconononnnnnncncnnnnnnnnnornrnnnnnnnnrrrnnnnnnns 202 A ei ni ecb eshccc sc cdig ace Ladakh E 203 E Creating d Sample Code ooooocconicnnniccc ninac alocada ninia listada cian 204 A o dd 207 MOO sata ibid 208 V1 9 9121416 epee ss Dd o nl e AT 209 Printer specifiCatiONS ici Ad EORR 209 IM e A 209 TIMO a A A A a a caracas 211 A A OO 213 TIMO aa e es 215 TM T70 Multi language Model oo een rr 217 IMD da AA A Aa 219 TM T70 Multi language model oI EE rrn rr rrrrrrrrrrr 221 IMFE9O NN 223 MA a a e 225 TM Divina tas A a va er Pea 227 A OS 229 TM PODIE with Peeler s 0ialcinistdaln a ti n 231 IM e e e De eee 233 TIM U220 ns ti A A A A ara 235 E Paper setting function Of TM L90 oooonncccconccccononcccnnnancnnnnncnnnnnnncnnnnncncnnnn nn nnnnnn rre recaen 237 Seting Pape Wii epa ia dieta 237 Automatic setting Of paper IAYOU EE rene rra rare eee rr 237 E Rendering in HTML5 CANVAS iiciin ti eae aeae aaaeeeaa anek unaiek aeiaai 238 Rendering Text canvas print text A MI s ssssrssresirrrserssrenrennrnnranrantantintrantantintnnnretantantnerenrennenena 239 Rendering Images CANVAS PrINT IMAGE NTM oer eneeiireriiies 241 Rendering Graphics CANVAS PriNT GrAPN ATM raro tintti nora rr rro rr rr 243 Rendering Handwritten Images CANVAS PriINT NANG ATM wo canino nro rr rr 245 Rendering Barcode Canvas print Darcode NIM oo ro nono rr rn rro rr rr 247 Render
53. 201234567890 3 Reset Test Print URL http 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Mode Monochrome Brightness 1 0 Halftone Monochrome Threshold w Alignment Left Color Monochrome Color 1 w V Cut Paper A Open the following URL page using the Web browser http Web server IP address canvas canvas print barcode html 2 EPSON ePOS Print Sample Program appears Set items on the right of the page The following items can be set A A A Position Specify the rendering coordinates Module Size Specify the width and height of the bars Data Specify EAN13 JAN13 data For 12 digit numerical data calculate and add the check digit For 13 digit numerical data verify the check digit For UPC A data add 0 at the start of the string to make it 12 or 13 digit data Clear Clears the image drawn in the Canvas Reset Clears the image drawn in the Canvas In addition the settings are reset to their default values 247 4 5 248 Click the Draw button The image is drawn on Canvas on the left of the page according to the settings made on the right of the page Set the following and click the Print button URL Enter the following URL http IP address of ePOS Print supported TM printen cgi bin epos service cgi devid device ID of printer to be used f
54. 35 1 TM Printer for Wireless LAN Model p 36 TM i Use TMNet WebConfig to configure the network settings such as IP address for the printer loja 2 z amp son TMNet WebConfi x Lic iy ve tes Configuration Network TCP IP Setting Wired Get IP Address Manual Set using Automatic Private IP Addressing APIPA 4 IP Address mrk Subnet Mask 3 Default Gateway 2 Acquire DNS Server Address Automatically SN a DNS Server Address Configure the settings according to the following procedure A Connect the printer to the network and turn the power ON 2 Start the Web browser and type the URL of the TM i interface into the address bar Enter the password http IP address of the TM intelligent printer PrinterConfigurationPage Firmware Ver 3 0 or later The initial value for the IP address of the TM i is a DHCP assigned address number Q If an address fails to be assigned via DHCP the value becomes 192 168 192 168 3 TMNet WebConfig starts Select as Configuration Wired Wireless TCP IP 4 The TCP IP Setting screen appears Configure the network settings for the TM i and click Submit 5 Print the status sheet using the TM i to check that the IP address has been updated 35 36 TM Printer for Wireless LAN Model 1 2 3 4 0 Connect the printer to a PC via the USB cable Turn on the printer Start u
55. A A a a 78 addlextPostion methodi nee uir A a a Matai 80 addaTextVPositiOn Methodi ita redondeo 81 adarsedUnitmSiROdlt ES Aa o 82 addFesdline MEMO iii a a id iia 83 adarsedPosition metida ri 84 adarFscameltno desacato lada taa ed da ad 86 addimagemethod ta AA A a aaa 87 adalogo metho daai dd 89 ole s 0 09 11 ennaa a iene A katy aineitera nie teats 90 GdESYMbol MethOG iii 95 OCEHLING Methods dada daa 101 AdaVLINEBSOGINIMEINOG i 103 adaVLinSER di MS MO eiii a a dd 105 ada PagsBegin Method vids t 107 adaPagsEnd MEO iria lea lr the a a a ia 108 GAOPAGSATE MEMO a 109 GAGPAGEDIFSCTION Metodai iiep tio daria 111 GAGPAGSPSSITIOMMEINO pocitos ie 113 adaPagelns Memo ura ia 115 adarPagsrectanale Meana anida 117 OdaCUT MEINOG meridia o 119 adarRulse Msi iaa iris 121 CAGSOUNG MEMO visi tala detente ds 123 adalayouUtmedO du 125 adaRecovery method ivive sai doo l io 130 addResest Method nran E A O EE A a A 131 ada Command MeliR iii s 132 toOSMTINO Medusa ain AS 133 Nalftone Properties ld stat 134 BriGhiness PIODEMY inde ares wan Sia 135 TOTES PIOPSMY sacas ia Ad aia 136 MESSAGES PPVs dd 137 MM ePOS Print Object uri cevestvdest sdevesecadsidheedecsechivtais 138 CONTI rd E a tias Po 138 So A ON A 139 A O vtec yy deus tunis eaa a a a see a aa ting sbotae E eA a tous 140 close MENOJ iru Rats Raila a ital aaa ls da aight iia led ae Aaa EE E Ai 141 address pipas ada daa ticas 142 enabled propery iris riyin esi aie ens rani E
56. AAAA AAAAAAAAAAAAAAAAAAAAAVQAAAAAAAAAawAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGqgAAAAAAAAGUAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAAAAAAA BAAAAAAAAAAAAAAAAqgAAAAAAAAAAAAAAAAAAAAAVQB4AAAAAAAAAAAAAAAUUAAAAAAAAAAAAAC4AAA AAAKKAAQAAAAAAAAAAAAAAGgQAAAAAAAAAAAAAIAAAAAADQIAUAAAAAAAAAAAAAAAECgAAAAAAAAAAAA Send Information 2012 06 21 14 57 45 Send 2012 06 21 14 57 46 PrintSuccess Clear Data to be sent The ePOS Print XML document is displayed ePOS Print XML Send Sends data to the printer and performs printing Information Displays the print status Clear Deletes the content in the Information box Perform printing as follows A Select the Print tab 2 Check the content in the Data to be sent ePOS Print XML box and press the 6 Send button The ePOS Print XML print document created using the Edit tab page is displayed in Data to be sent ePOS Print XML 3 The print document is printed to ePOS Print supported TM printer The acquired status is displayed in the Information box 207 208 ePOS Print Editor can import and re edit the ePOS Print XML print document once created Note that you cannot perform import operation using ePOS Print API source code NM Perform import operation using ePOS Print XML print data ma MJ IA A mg mere Lang Font Position Position rk g Pa ad EE a Import x Smooth Size Dou Data to be import ePOS Print XML l
57. AE A A AAA 143 interval Property A 144 stat s Proper noric ATA a eis d avin nll oi a aa irat lindas APA a Aa 145 barten PIOD oO ad 146 TIMGOUT POP Vii rt o E E a EE a ED DE 147 ONTECEIVE COVENT inicio nono corororrrorrrrrrr 148 ARS A Hien hawies Maa AB hl AG ARS Re ea Alen A a 151 ONSTATUSCNANGE OVEN rro rr 152 onbatterystatUSCHANDES Svo Nisur onara aici ein Cd E dC CA 153 NS sevice lia istangsce sagt caskesigh hedpaubeay sagd sntesa duneguseapaenyuses taneelanrereava Svawubceaguacaunsdeanstneusglectaggeseanes 153 ONOMING SVENT aus e GeO Blan va hd ate did Mim a Maen ae 154 OMPOWSIOM SVS ial ra scctvrisacaveacatc onened dd loa T 154 ONCOVEIOK Micerino dla E a E is itera 155 ONCOVESODEN EVEN ccccicicconociroro nino rorrrrroR 155 ONBGPEIOk VA di A a 156 ONPAPEMEALENC OVEN nono roo raro rr 156 PAPES UN inci ca ce A A AA AER AO 157 ARTES A 157 OA OPA eventos nen A la 158 ONBATIErVOK EVEN iii e enti 158 onbatlerlowSVeN Ticas lo ta a dl 159 POS Print Canvas API ocio i 161 E List of ePOS Print Canvas API fUNCHONS oooocccconoccccnononanoncncnononannncncnnnnnnnnnnnonnnnnnnnnnnnnn 161 window epson CanvasPrint COMPONENTS occccccocnnnccononnnonnnnonnnnncnnonnnonnonconnnrnrnr nono nr n rr nro a rr nrnnconnrnnnnnos 161 E ePOS Print Canvas API ODjeCT cccccccesseceeeeeeesseeeeeeeeesseeeeeeeeessneneeeeeesseeaeeseeeeseeenaeeees 164 COMSITUGTON ro io 164 pnnt method ii A AA A A A a a 165 Open MeMO dreri hail salvinedtiadeere tial
58. AN13 builder addBarcode 201234567890 builder BAROCDE_JAN13 builder addBarcode 2012345 builder BAROCDE_EANS8 builder addBarcode 2012345 builder BAROCDE_JANS8 builder addBarcode ABCDE builder BAROCDE_CODE39 builder addBarcode 012345 builder BAROCDE_ ITF builder addBarcode A012345A builder BAROCDE_CODABAR builder addBarcode ABCDE builder BAROCDE_CODE93 builder addBarcode Babcde builder BAROCDE_CODE128 builder addBarcode 01 201234567890 builder BAROCDE _GS1_128 builder addBarcode 0201234567890 builder BAROCDE_GS1_DATABAR OMNIDIRECTIONAL builder addBarcode 0201234567890 builder BAROCDE GS1_ DATABAR TRUNCATED builder addBarcode 0201234567890 builder BAROCDE GS1_ DATABAR LIMITED builder addBarcode 01 2012345678903 builder BAROCDE GS1_ DATABAR EXPANDED gt lt script gt Chapter 4 ePOS Print API addSymbol method Adds two dimensional symbol printing to the command buffer In page mode a two dimensional symbol is laid out in the current print position with the Q reference point being its bottom left dot Syntax addSymbol data type level width height size Parameter e data Required parameter Object type String Specifies two dimensional symbol data as a character string 2D Code type Description Standard PDF417 Convert the character string to the string in UTF 8 apply the escape sequence and then
59. ATABAR_TRUNCATED 6S1 DataBar Truncated BARCODE_GS1_DATABAR_LIMITED 6S1 DataBar Limited BARCODE_GS1_DATABAR_EXPANDED 6S1 Databar Expanded Chapter 4 ePOS Print API e hri Optional parameter Object type String Specifies the HRI position Constant hr HRI_NONE default HRI not printed HRI_LABOVE Above the bar code HRI_BELOW Below the bar code HRI_BOTH Both above and below the bar code e font Optional parameter Object type String Specifies the HRI font Constant on FONT_A default Font A FONT_B Font B FONT_C Font C e width Optional parameter Object type Number Specifies the width of each module in dots Specifies an integer from 2 to 6 e height Optional parameter Object type Number Specifies the barcode height in dots Specifies an integer from 1 to 255 Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error 93 Example To print barcodes lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addBarcode 01234567890 builder BAROCDE_UPC_A builder HRI_ BELOW undefined 2 64 builder addBarcode 01234500005 builder BAROCDE_UPC_E builder addBarcode 201234567890 builder BAROCDE_E
60. B ANK 10 dots x 24 dots W x H Font C ANK 8 dots x 16 dots W x H Character Font A At the 21st dot from the top of the character Baseline Font B At the 21 st dot from the top of the character Font C At the 15 th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Raster Image Monochrome image Logo Monochrome image Bar Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE89 ITF CODABAR CODE93 CODE128 GS1 128 GS1 DataBar Omnidirectional GS1 DataBar Truncated 6S1 DataBar Limited 6S1 DataBar Expanded PDF417 QR Code MaxiCode 6S1 DataBar Stacked 6S1 DataBar Stacked Omnidirectional GS1 DataBar Expanded Stacked Aztec Code DataMatrix Composit Symbology Not supported Two Dimensional Code Ruled Line Not supported Page Mode Default Area 420 dots x 1200 dots W x H 432 dots x 1200 dots W x H Page Mode Maximum Area 420 dots x 1200 dots W x H 432 dots x 1200 dots W x H 229 Receipt 58mm Receipt 60mm Page Mode Line Supported Only solid line Rectangle Paper Cut Cut Feed cut Specification of the paper feed position for labels black mark Not supported paper Drawer Kick Out Not supported Buzzer Support Pattern1 Pattern 10 Stop Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 230
61. Begin p 107 and PageEnd p 108 Syntax addPageLline x1 yl x2 y2 style Parameter e xt Required parameter Object type Number Specifies the horizontal start position of the line in dots Specifies an integer from 0 to 65535 e yl Required parameter Object type Number Specifies the vertical start position of the line in dots Specifies an integer from 0 to 65535 e x2 Required parameter Object type Number Specifies the horizontal end position of the line in dots Specifies an integer from 0 to 65535 e y2 Required parameter Object type Number cSpecifies the vertical end position of the line in dots Specifies an integer from 0 to 65535 e style Optional parameter Object type String Specifies the line type Constant siie LINE_THIN Solid line Thin LINE_MEDIUM Solid line Medium LINE_THICK Solid line Thick LINE_THIN_DOUBLE Double line Thin LINE_MEDIUM_DOUBLE Double line Medium LINE_THICK_DOUBLE Double line Thick undefined Solid line Thin When not specified Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error 115 Example To draw a thin solid line between the start position 100 0 and the end position 500 0 lt script type text javascript src epos print 3 x x js gt lt script gt lt script
62. Distance from the bottom of without black mark label to the cutting position Die cut label O to 50 Distance from the top of black mark to the cutting position 185 e Value of offset_label Object type Number When not specified 0 Specifies label bottom position sd per 0 1mm unit Paper ype Vall value range Receipt 0 Setup not necessary without black mark Receipt with black mark 0 Die cut label 0 without black mark Die cut label Oto 15 Distance from the top of black with black mark mark to the bottom of label Layout property positions that can be designated for each type of paper lt without Black Mark gt lt with Black Mark gt sf sf at pat sb a po ee Top positions ES aS sc a Receipt sa PT A lo sf CUAN pp Top position Top position Label se sa Bottom edge se sal Bottom edge of print area sd Cut of print area HHH Standard ejects SHEy Y NS So IN ieee HE sc Bottom edge sc of label Mark Parameter sf width sa height sb margin_top se margin_bottom sc offset_cut sd offset_label 186 Chapter 5 ePOS Print Canvas API Example To set 58mm receipt without black mark lt script type text javascript lt script type text javascript gt eles var address src epos print 3 x x j
63. EPSON EXCEED YOUR VISION ePOS Print API User s Manual Overview Describes the features and development environment Sample Program Describes how to use the sample program and how to build a system Programming Guide Describes how to write programs in Web application development ePOS Print API Describes the ePOS Print API ePOS Print Canvas API Describes the ePOS Print CanvasAPI ePOS Print Editor Describes the ePOS Print Editor Appendix Describes the specifications for printers used for ePOS Print how to use the rendering of images in HTML5 Canvas MO00042107 Rev H Cautions No part of this document may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without the prior written permission of Seiko Epson Corporation e The contents of this document are subject to change without notice Please contact us for the latest information e While every precaution has taken in the preparation of this document Seiko Epson Corporation assumes no responsibility for errors or omissions e Neither is any liability assumed for damages resulting from the use of the information contained herein Neither Seiko Epson Corporation nor its affiliates shall be liable to the purchaser of this product or third parties for damages losses costs or expenses incurred by the purchaser or third parties as a
64. Error Example To set the print position at 120 dots from the left end lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextPosition 120 gt lt script gt Chapter 4 ePOS Print API addTextVPosition method Adds the vertical print start position of text to the command buffer in firmware Ver 3 0 and later Use this API function by inserting it between addPageBegin to addPageEnd Syntax addTextVPosition y Parameter e y Required parameter Object type Number Specifies the vertical print start position in dots Specifies an integer from 0 to 65535 Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example To set the print position at 120 dots from the top 4 lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addTextVPosition 120 builder addPageEnd gt lt script gt 81 addFeedUnit method Adds paper feeding in dots to the command buffer Syntax addFeedunit unit Parameter e unit R
65. Its high scalability enables users to build versatile POS systems The system is compatible with all types of EPSON POS printers excluding the TM C100 and displays Moreover its flexibility makes it easy to upgrade the future The functionality and the user friendliness is valued around the world Copyright 2011 2013 Seiko Epson Corporation All rights reserved For Safety AO OS The symbols in this manual are identified by their level of importance as defined below Read the following carefully before handling the product Provides information that must be observed to avoid damage to your equipment or a NM malfunction Q Provides important information and useful tips Restriction of Use When this product is used for applications requiring high reliability safety such as transportation devices related to aviation rail marine automotive etc disaster prevention devices various safety devices etc or functional precision devices etc you should use this product only after giving consideration to including fail safes and redundancies into your design to maintain safety and total system reliability Because this product was not intended for use in applications requiring extremely high reliability safety such as aerospace equipment main communication equipment nuclear power control equipment or medical equipment related to direct medical care etc please make your own judgment on this product s suitability after a full
66. ODE89 ITF CODABAR CODE93 CODE128 Two Dimensional Code PDF417 QR Code MaxiCode Ruled Line Not supported 223 Receipt Die cut label Page Mode Default Area 576 dots x 738 dots W x H 560 dots x 738 dots W x H when two 576 dots x 369 dots W x H 560 dots x 369 dots W x H color printing is set Page Mode Maximum Area 576 dots x 1476 dots W x H 560 dots x 1476 dots W x H when two 576 dots x 738 dots W x H 560 dots x 738 dots W x H color printing is set Page Mode Line Not supported Rectangle Paper Cut Cut Feed cut Specification of the paper feed position for labels black mark Supported paper Drawer Kick Out Supported Buzzer Not supported Paper Layout Settings Not supported With automatic setup mode Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 224 Appendix TM L90 Receipt Die cut label Interface Ethernet Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 256 dots 38mm to 224 dots 38mm to 576 dots 80mm 560 dots 80mm Font Font A Font B Font C For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Font A ANK 48 characters ANK 46 characters Line Font B ANK 57 characters ANK 56 characters Font C
67. Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error 111 Example To print the characters ABCDE by rotating them 90 degrees clockwise lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt of a function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addPageArea 100 50 30 200 builder addPageDirection builder DIRECTION_TOP_TO_ BOTTOM builder addText ABCDE builder addPageEnd gt lt script gt 112 Chapter 4 ePOS Print API addPagePosition method Adds the page mode print position set area to the command buffer Specifies the print start position coordinates in the area specified by the addPageArea method Q Use this API function by inserting it between addPageBegin p 107 and PageEnd p 108 Syntax addPagePosition x y Parameter e x Required parameter Object type Number Specifies the horizontal print position in dots Specifies an integer from 0 to 65535 e y Required parameter Object type Number Specifies the vertical print position in dots Specifies an integer from 0 to 65535 Specify the print start position coordinates according to the content to be printed Refer to the Q following To print a character string Specify the left end of t
68. Object type 4 ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error 119 Example To perform feed cut operation lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt a function buildMessage var builder new epson ePOSBuilder builder addCut builder CUT_FEED gt lt script gt 120 Chapter 4 ePOS Print API addPulse method Adds the drawer kick to the command buffer Sets the drawer kick e Not available in page mode AN e The drawer and the buzzer cannot be used together Syntax addPulse drawer time Parameter e drawer Optional parameter Object type String Specifies the drawer kick connector Description DRAWER_1 Pin 2 of the drawer kick out connector DRAWER_2 Pin 5 of the drawer kick out connector undefined Pin 2 of the drawer kick out connector When not specified e time Optional parameter Object type String Specifies the ON time of the drawer kick signal EE O ae PULSE_100 100 ms PULSE_200 200 ms PULSE_300 300 ms PULSE_400 400 ms PULSE_500 500 ms undefined Me 100 ms When not specified Return value Return value ePOS Print Builder Object Object type ePOS Builder Exception Exception Parameter is invalid Object type Error 121 Examp
69. PCs or servers are required for printing Allows printing from public and private clouds Allows printing in languages supported in Web browsers Automatically checks the status of the TM printer before printing There is no need for checking the status of the TM printer in advance Supported in firmware Ver 1 2 and later Does not respond to a printer s function to automatically send its status AutoStatusBack Instead capa ble of sending an empty print command and checking the status of the TM printer based on the result of command transmission Supported in firmware Ver 1 2 and later To change the printer settings utility programs dedicated to each printer or other utility programs should be used In case of TM i series it can print to other TM printer via TM i Provides ePOS Print API and ePOS Print Canvas API lt lt ePOS Print API gt gt e Allows device fonts to be used for printing e Allows barcode printing lt lt ePOS Print Canvas API gt gt e Allows printing of images rendered in HTMLS Canvas e Allows TrueType fonts to be used for printing Chapter 1 Overview Print Example ePOS Print API Sample Shop Printing a Logo VERY VERY STORE GT XXX XXX XXXX THANK YOU FOR SHOPPING WITH US alignment Center Paper Feed 101023 Orange juice 108956 Chocolate 000210 GT Special Subtotal To Stay Total Cash Change Due Paper Feed and Paper Cut Sample Shap _Printing a raster image
70. Specifies the timeout time default 60000 Print in grayscale Coupon Only for supported models IP address of the ePOS Print supported printer Device ID of the target printer Prints coupons in gray scale Default No Set the paper layout Label Only for TM P60I Prints a label in a specified layout Default No 254 Appendix It executes printing Samples Queue Ticket Queue Ticket Prints queue ticket numbers oupon in ePOS Print API Run the program according to the following procedure A Select a type of printing from the left screen There are following printing types Prints queue ticket numbers This is a sample program using the ePOS Print API Prints coupons This is a sample program using the ePOS Print Canvas API Queue Ticket Coupon Prints labels L ae This is a sample program using the ePOS Print API 2 Press Print 255 256
71. TM T88V i A TM T70 1 A TM L90 i TM Printer 1 TM P60ll 1 TM P O0I with Peeler Q Unable to control other TM printer Printers That Can Be Controlled Refer to the Technical Reference Guide for the TM i series 17 System Construction Example Registering a Web Application Into the Web Server lt Web Server gt lt Printers That Can Be Controlled gt Web Application Wireless LAN Router Sea 68 8 lt Terminal gt Web Browser Wireless a Network T Web Server A Web application is placed A Terminal Executes the Web application using a browser HTML5 supported Web browser A TM i Receives prints print data sent from the Web browser or controls other devices MO Printers That Can Be Controlled Print the print data received from the TM i 18 Chapter 1 Overview a Registering a Web Application Into a TM i Wireless LAN Router lt Terminal gt Web Browser Web Application d Terminal Executes the Web application using a browser T TM i Wireless Sa ang 8 Device Control Fc Network Mounts the Web application Creates and prints the print data using transmission with the input terminal s Web browser 19 Registering a Web application to a cloud lt Web Server gt Web Application Wireless LAN Router lt Terminal gt Web Browser lt TM Printer gt Wireless LAN Model Wirele
72. _MAXICODE_MODE_2 MaxiCode Mode 2 SYMBOL_MAXICODE_MODE_3 MaxiCode Mode 3 SYMBOL_MAXICODE_MODE_4 MaxiCode Mode 4 SYMBOL_MAXICODE_MODE_5 MaxiCode Mode 5 SYMBOL_MAXICODE_MODE_6 MaxiCode Mode 6 SYMBOL_GS1_DATABAR_STACKED GS1 DataBar Stacked SYMBOL_GS1_DATABAR_STACKED_ GS1 DataBar Stacked OMNIDIRECTIONAL Omnidirectional SYMBOL_GS1_DATABAR_EXPANDED_STACKED GS1 DataBar Expanded Stacked Aztec Code Full Range mode SYMBOL_AZTECCODE_FULLRANGE FU in firmware Ver 2 2 and later Aztec Code Compact mode in firmware Ver 2 2 and later DataMatrix ECC200 square in firmware Ver 2 2 and later DataMatrix ECC200 rectangle SYMBOL_DATAMATRIX_RECTANGLE_8 8 lines in firmware Ver 2 2 and later DataMatrix ECC200 rectangle SYMBOL_DATAMATRIX_RECTANGLE_12 12 lines in firmware Ver 2 2 and later DataMatrix ECC200 rectangle SYMBOL_DATAMATRIX_RECTANGLE_16 16 lines in firmware Ver 2 2 and later SYMBOL_AZTECCODE_COMPACT SYMBOL_DATAMATRIX_SQUARE 97 e level Optional parameter Object type String Specifies the error correction level Constant eve LEVEL_O PDF417 error correction level O LEVEL_1 PDF417 error correction level 1 LEVEL_2 PDF417 error correction level 2 LEVEL_3 PDF417 error correction level 3 LEVEL_4 PDF417 error correction level 4 LEVEL_5 PDF417 error correction level 5 LEVEL_6 PDF417 error correction level 6 LEVEL_7 PDF417 error c
73. _RESPONSE No printer response n amp epos ASB_PRINT_SUCCESS Print complete n amp epos ASB_DRAWER_KICK Status of the drawer kick number 3 connector pin amp epos ASB_OFF_LINE Offline status n amp epos ASB_COVER_OPEN Cover is open n amp epos ASB_PAPER_FEED Paper feed switch is feeding paper n amp epos ASB_WAIT_ON_LINE Waiting for online recovery n amp epos ASB_ PANEL SWITCH Panel switch is ON n amp epos ASB MECHANICAL ERR Mechanical error generated n epos ASB_AUTOCUTTER_ERR Auto cutter error generated n amp epos ASB_UNRECOVER_ERR Unrecoverable error generated n amp epos ASB_AUTORECOVER_ERR Auto recovery error generated n T amp epos ASB_RECEIPT_NEAR_END No paper in the roll paper near end detectorWn amp epos ASB_RECEIPT_END No paper in the roll paper end detector n amp epos ASB_BUZZER Sounding the buzzer limited model n amp epos ASB_SPOOLER_IS_STOPPED Stop the spooler n Display in the dialog box H n Chapter 3 Programming Guide Reception of Status Event The status event notification function is used to check the printer status without printing in firmware Ver 1 2 and laten Refer to the following Set the end point addres
74. ae 2 Hello World x0 y24 Hello World Text Hello World Hello World 3 Style Obold Ditalic E small caps font size 24 px line height 30 px font family Arial sans serif text align stat itext baseline alphabetic Clear Test Print 4 URL http 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Property Mode Monochrome Brightness 1 0 Halftone Monochrome Threshold X Print Alignment Let Color Monochrome Color 1 V Cut Paper A Open the following URL page using the Web browser http Web server IP address canvas canvas print text html 2 EPSON ePOS Print Sample Program appears Set items on the right of the page The following items can be set Position Specify the rendering coordinates Text Specify the text to be printed Style Specify the text style Clear Clears the image drawn in the Canvas Reset Clears the image drawn in the Canvas In addition the settings are reset to their default values 239 4 5 240 Click the Enter button The text is printed on Canvas on the left of the page according to the settings made on the right of the page Set the following and click the Print button URL Enter the following URL http IP address of ePOS Print supported TM printen cgi
75. ages Embed the script into the Web page by using the HTML lt script gt tags lt DOCTYPE html gt lt html gt lt head gt lt meta charset utf 8 gt lt title gt TITLE lt title gt lt script type text javascript src epos print 3 x x js gt lt script gt Embed lt script type text javascript gt function buildMessage var builder new epson ePOSBuilder lt script gt lt head gt lt body gt lt body gt lt html gt 43 Print Document Creation A print document is created using an ePOS Print Builder object Create an ePOS Print Builder object using the constructor for it create a print document using the object s methods and then acquire that print document using the toString method For details refer to List of API functions p 59 Refer to the following program for print document creation lt DOCTYPE html gt lt html gt lt head gt lt meta charset utf 8 gt lt title gt TITLE lt title gt lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt function buildMessage Create an ePOS Print Builder object var builder new epson ePOSBuilder Create a print document builder addTextLang en builder addText Smooth true builder addTextFont builder FONT_ A Create a print document builder addTextSize 3 3 builder addText Hello tWorld n builder addCut builde
76. ample Program appears Set items on the right of the page The following items can be set Name Specifies print data in the name field of label Description Specifies print data in the description field of label Code Prints barcode corresponding to the value e EANI3QVAN13 In case of 12 digits check digit is added In case of 13 digits check digit is added e UPC A Add 0 at the beginning and adjust to 12 to 13 digits Price Specifies print data in the price field of label Clear Clears the image drawn in the Canvas Reset Clears the image drawn in the Canvas In addition the settings are reset to their default values 249 Click the Draw button The image is drawn on Canvas on the left of the page according to the settings made on the right of the page 4 Set the following and click the Print button URL Enter the following URL http IP address of ePOS Print supported TM printer cgi bin epos service cgi devid device ID of printer to be used for printing amp timeout timeout time Mode Set the color mode Monochrome Grayscale Brightness Adjust the brightness Gamma value in the range 0 1 10 0 tendencia Set the halftone processing method for monochrome printing two tone Alignment Specify the printing position alignment Color Monochrome Specify the printing color in 2 tone Paper Specifie the paper type Feed to Specify the paper feeding positi
77. an E Japanese JJ International character set changes to Japan Ko Korean International character set changes to Korean koki Korean International character set changes to Korean EA Simplified Chinese in firmware Ver 2 2 and later International character set changes to China Hs Simplified Chinese International character set changes to China zh hant Traditional Chinese in firmware Ver 2 2 and later zh tw Traditional Chinese Language code besides above English ANK Characters not installed in a printer cannot be printed printer A x For printable character code refer to the Technical Reference Guide of your Chapter 4 ePOS Print API Depending on language specification a part of characters is printed as follows Characters U 0024 Characters U 005C Japanese Y Korean wW Simplified Chinese Traditional Chinese Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception 0 11 41013 Parameter is invalid Error Example To set the language as English lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextLang en gt lt script gt To set the language as Korean lt script type text
78. an image 300 dots wide and 300 dots high in page mode var canvas document getElementById myCanvas var context canvas getContext 2d var builder new epson ePOSBuilder builder addPageBegin builder addPageArea 0 0 300 300 builder addPagePosition 0 299 builder addImage context 0 0 300 300 builder addPageEnd Chapter 4 ePOS Print API addLogo method Adds NV logo printing to the command buffer Prints a logo registered in the NV memory of the printer Using model dedicated utility or logo registration utility MFLogo register a logo in the Q printer in advance e In page mode a logo is laid out in the current print position with the reference point being its bottom left dot Syntax addLogo key1 key2 Parameter e keyl Required parameter Object type Number Specifies the key code 1 of an NV logo Specifies an integer from 0 to 255 e key2 Required parameter Object type Number Specifies the key code 2 of an NV logo Specifies an integer from 0 to 255 Return value Object ype ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error 4 Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addLogo 48 48
79. anvas document getElementById myCanvas var epos new epson CanvasPrint address epos brightness 2 2 epos print canvas gt lt script gt 177 cut property It sets with or without paper cut Object type Boolean Description It specifies with or without paper cut true 1 Cut paper after printing false 0 Default Do not cut paper Example It sets paper cut after printing lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt a var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementBylId myCanvas var epos new epson CanvasPrint address epos cut true epos print canvas gt lt script gt 178 Chapter 5 ePOS Print Canvas API mode property It sets the color mode Object type String Description It specifies the color mode MODE_MONO Default Monochrome 2 tone MODE_GRAY16 Multiple tones 16 tone Example Prints with multiple tones lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos mode epos MODE_GRAY16 epos print canvas
80. aper in roll paper end sensor ASB_BUZZER ASB_WAIT_REMOVE_LABEL A buzzer is on only for applicable devices Waiting period for removal of label only for applicable devices in firmware Ver 2 1 and later ASB_NO_LABEL No paper in label peeling sensor only for applicable devices in firmware Ver 2 1 and later ASB_SPOOLER_IS_STOPPED The spooler has stopped Not used e Value of battery 0 is shown when the model doesn t have a battery installed Status of power value eatery Ox30XX AC adapter is connected Ox31XX AC adapter is not connected Remaining battery value batery OxXX36 Remaining battery 6 OxXX35 Remaining battery 5 OxXX34 Remaining battery 4 OxXX33 Remaining battery 3 OxXX32 Remaining battery 2 OxXX31 Remaining battery 1 Near end OxXX30 Remaining battery 0 Real end Chapter 5 ePOS Print Canvas API Example To print Canvas ID myCanvas To display the print result in a message box lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function printCanvas var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos onreceive function res var success res success var code res code var status res stat
81. argin in units of 0 1mm Paper Type Valid value range Receipt with black mark 0 Set t without black mark OURS Scans Dist f the t f Receipt with black mark 150 to 1500 O A black mark Die cut label Distance from the top of to 1500 without black mark ado label Die cut label 15 to 1500 Distance from the bottom of black mark Number When not specified 0 Specifies bottom margin in units of 0 1mm Paper Type Valid value range with black mark Receipt 0 without black mark Setup not necessary Receipt with black mark 0 Die cut label Distance from the poom of witan oek mone 15to 0 label paper feed direction is a positive number Distance from the top of Die cut label 154015 black mark paper feed direction is a positive num ber Optional parameter Object type Number When not specified 0 Specifies cut position in units of 0 1mm In case of die cut label paper it is a distance from the bottom of label When a paper has black mark it is a distance from the beginning of black mark Paper Type Valid value range Receipt with black mark without black mark 9 a say Distance from the top of Receipt with black mark 290 to 50 black mark to the cutting position Die cut label Oto 50 Distance from the bottom of without black mark label to the cutting position Distance from the top of Bie eu aes Oto 50
82. avascript gt lt function buildMessage var builder new epson ePOSBuilder builder addText ABCDE builder message gt lt script gt 137 ePOS Print Object 138 Sends a print document created using an ePOS Print Builder object to control the printer and monitor the transmission result or the communication status Constructor for an ePOS Print object Creates a new ePOS Print object and initializes it Syntax ePOSPrint address Parameter e address Optional parameter Object type String Specifies the URL of the printer to send a print document to in firmware Ver 1 2 and later The URL is as follows http IP address of ePOS Print supported TM printer cgi bin epos service cgi devid device ID of printer to be used for printing amp timeout timeout time Example lt script type text javascript lt script type text javascript gt lt function sendMessage var address http 192 168 var epos gt lt script gt src epos print 3 x x js gt lt script gt 192 168 cgi bin epos service cgi devid local_printer new epson ePOSPrint address Chapter 4 ePOS Print API send method Sends a print document created using an ePOS Print Builder object A print document is obtained by executing the toString method p 133 of the ePOS Print Builder Q S object Syntax send request
83. black mark to the cutting position Chapter 4 ePOS Print API e offset label Optional parameter Object type Number When not specified 0 Specifies label bottom position sd per 0 1mm unit Paper Type Valid value range Receipt 0 without black mark Receipt with black mark 0 Setup not necessary Die cut label 0 without black mark Dist f the t f Saba istance from the top o a Oto 15 black mark to the bottom of with black mark eEG Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception pect ype Parameter is invalid Error 127 Detailed description See below for the parameters that can be specified for each type of paper and the positions for those parameters Mark Parameter sf width sa height sb margin_top se margin_bottom sc offset_cut sd offset_label lt without Black Mark gt sf A Se Receipt 128 Bottom edge Cut of print area a of label lt with Black Mark gt sf j sb ie bc Top position j i aN yes eet ts es Se ee H i Gure sa E A sf Cue jo Top position Bottom edge se sa of print area sd Standard ejects H 7 Y E Bottomedge j sc Example Chapter 4 ePOS Print API To set 58mm receipt without black mark
84. by rendering an image in HTML5 Canvas into the command buffer using the addlmage method Refer to the following program To create a print document for the image file logo bmp lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt function buildMessage Create an ePOS Print Builder object var builder new epson ePOSBuilder Render an image in HTML5 Canvas var canvas document getElementBylId canvas var context canvas getContext 2d context drawImage document getElementById logo 0 0 200 70 Create a print document builder addTextAlign builder ALIGN_CENTER builder addImage context 0 0 canvas width canvas height builder COLOR_1 builder addCut builder CUT_FEED Acquire the print document var request builder toString lt script gt This section describes how to print a raster image In addition there is also a method of printing Q graphics registered in the NV memory of the printer For details refer to addLogo method p 89 Chapter 3 Programming Guide To create a page mode print document When the addPageBegin method is stored in the command buffer the page mode starts Store the print area addPageArea method and the print start position addPagePosition method into the command buffer Specify the print start position according to the print data After that store the method
85. cal scale When not specified Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception 4 Exception Object type Parameter is invalid Error Example To set a horizontal scale of x 4 and a vertical scale of x 4 lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextSize 4 4 gt lt script gt 77 78 addTextStyle method Adds the text style setting to the command buffer Syntax addTextStyle reverse ul em color Parameter e reverse Optional parameter Object type Boolean Specifies inversion of black and white for text Specifies the inversion of black and white parts true or 1 of characters ET CE Cancels the inversion of black and white parts of characters undefined Retains the current setting for inversion of black When not specified and white e ul Optional parameter Object type Boolean Specifies the underline style RESRBESC abla re SC e true or 1 Specifies underlining false or O default Cancels underlining undefined ES Retains the current underlining setting When not specified e em Optional parameter Object type Boolean Specifies the bold style AE ASAS true or 1 Specifies emphasized printing o
86. ction alert batteryok Y epos open gt lt script gt src epos print 3 x x js gt lt script gt onbatterylow event Registers call back function and obtains no remaining battery event in firmware Ver 2 2 and later Syntax Function Example lt script type text javascript lt script type text javascript gt lt var address src epos print 3 x x js gt lt script gt http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onbatterylow function alert batterylow Y epos open gt lt script gt 195 ononline event Registers a callback function to obtain a online event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos ononline function alert online Y epos open gt lt script gt onoffline event Registers a callback function to obtain a offline event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var addre
87. d Paper Layout Settings Not supported With automatic setup mode Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 226 Appendix TM T90 58mm 60mm 80mm Interface Ethernet Wireless LAN Resolution 180 dpi x 180 dpi W x H Print Width 360 dots 384 dots 512 dots Font Font A Font B For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Font A ANK 30 characters ANK 32 characters ANK 42 characters Line Font B ANK 40 characters ANK 42 characters ANK 56 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 17 dots W x H Character Font A At the 21st dot from the top of the character Baseline Font B At the 16 th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color First color Second color when two color printing is set Raster Image Monochrome image Two color image Logo Bar Code Monochrome image Two color image To perform two color printing change the settings of the printer using the memory switch setting utility UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 Two Dimensional Code PDF417 Ruled Line Not supported Page Mode Default Area 360 dots x 831 dots WxH
88. d EPTR_CUTTER An autocutter error occurred EPTR_MECHANICAL A mechanical error occurred EPTR_REC_EMPTY No paper in roll paper end sensor EPTR_UNRECOVERABLE An unrecoverable error occurred SchemcError The request document contains a syntax error a ae with the specified device ID does not PrintSystemeError An error occurred on the printing system EX_BADPORT An error was detected on the communication port EX_TIMEOUT A print timeout occurred e Value of status Constant status ASB_NO_RESPONSE Chapter 4 ePOS Print API Description No response from the TM printer ASB_PRINT_SUCCESS Printing is successfully completed ASB_DRAWER_KICK Status of the 3rd pin of the drawer kick out connector H ASB_BATTERY_OFFLINE Battery offline status only for applicable devices in firmware Ver 2 2 and later ASB_OFF_LINE Offline ASB_COVER_OPEN The cover is open ASB_PAPER_FEED ASB_WAIT_ON_LINE Paper is being fed by a paper feed switch operation Waiting to be brought back online ASB_PANEL_SWITCH The paper feed switch is being pressed ON ASB_MECHANICAL_ERR ASB_AUTOCUTTER_ERR A mechanical error occurred An autocutter error occurred ASB_UNRECOVER_ERR An unrecoverable error occurred ASB_AUTORECOVER_ERR ASB_RECEIPT_NEAR_END An automatically recoverable error occurred No paper in roll paper near end sensor ASB_RECEIPT_END No paper in roll paper e
89. d p 111 instead of this API function Syntax addTextAlign align Parameter e align Required parameter Object type String Specifies the text alignment Constent aign ALIGN_LEFT default Alignment to the left ALIGN_CENTER Alignment to the center ALIGN_RIGHT Alignment to the right Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example To set alignment to the center lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextAlign builder ALIGN_CENTER gt lt script gt 66 Chapter 4 ePOS Print API addTextLineSpace method Adds the line feed space setting to the command buffer Syntax addTextLineSpace linespc Parameter e linespc Required parameter Object type Number Specifies the line feed space in dots Specifies an integer from 0 to 255 Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example To set the line feed space to 30 dots lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt
90. ddress http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos paper epos PAPER_LABEL epos feed epos FEED_PEELING epos print canvas gt lt script gt 183 layout property It sets paper layout in firmware Ver 2 2 and later Object type Object Description It specifies paper layout Property of layout being setup Property Object type width Paper width Number height Paper height Number margin_top Top margin Number margin_bottom Bottom margin Number offset_cut Cutting position Number offset_label Bottom position of label Number e Value of width Object type Number When not specified 580 Specifies paper width in units of 0 1mm Specifies an integer from 290 to 600 e Value of height Object type Number When not specified 0 Specifies paper height in units of 0 1mm Paper Type Valid value range Receipt 0 Setup not necessary without black mark Distance from the top of black Receipt with black mark mark to the top of next black mark Die cut label 0 auto Distance from the top of label to without black mark 284 to 1550 manual the top of next label Distance from the bottom of black mark to the bottom of next black mark Die cut label with black mark 184 Chapter 5 ePOS Print Ca
91. digit number GS 1 DataBar Stacked GS1 DataBar Stacked Omnidirectional Convert the character string to the string in UTF 8 apply the escape sequence and then encode the string Specify a 13 digit global trade item number GTIN not including an application identifier Al or a check digit GS1 DataBar Expanded Stacked Convert the character string to the string in UTF 8 apply the escape sequence and then encode the string You can enclose an application identifier Al in parentheses The parentheses are used as HRI print characters and are not encoded as data To encode each of the following characters specify two characters starting with the character FNC1 1 C K D Aztec Code After converting the character string to UTF 8 conduct the escape sequence and encode DataMatrix After converting the character string to UTF 8 conduct the escape sequence and encode Chapter 4 ePOS Print API To specify binary data that cannot be represented by character strings use the following escape sequences CA NN xnn Control code Back slash e type Required parameter Object type String Specifies the two dimensional symbol type Constant type 2D Code type SYMBOL_PDF417_STANDARD Standard PDF417 SYMBOL_PDF417_TRUNCATED Truncated PDF417 SYMBOL_QRCODE_MODEL_ 1 QR Code Model 1 SYMBOL_QRCODE_MODEL_2 QR Code Model 2 SYMBOL
92. e Maximum Area 512 dots x 1662 dots W x H Raster image Monochrome image Logo Monochrome image Bar Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE839 ITF CODABAR CODE93 CODE128 Two Dimensional Code PDF417 QR Code Ruled Line Not supported Paper Cut Cut Feed cut at Aaa E a Netsuppered Drawer Kick Out Supported Buzzer Not supported Paper Layout Settings Not supported 215 80mm Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 216 Appendix TM T70 i Multi language model 80mm Interface Ethernet Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 576 dots Font Font A Font B For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Line Font A ANK 48 characters Font B ANK 64 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 17 dots W x H Character Baseline Font A At the 21st dot from the top of the character Font B At the 15th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area 576 dots x 1662 dots W x H Page Mode Maximum Area 576 dots x 1662 dots W x H Raster image Monochrome image Logo Monochrome image Ba
93. e Ver 2 1 and later e Control of label paper black mark paper must be done in the standard mode Q e Inthe page mode addFeedPosition method specification cannot be used Syntax addFeedPosition pos Parameter e pos Required parameter Object type String Specifies the feed position FEED_PEELING Feeds to the peeling position FEED_CUTTING Feeds to the cutting position FEED_CURRENT_TOF Feeds to the top of the current label FEED_NEXT_TOF Feeds to the top of the next label Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object ype Parameter is invalid Error Chapter 4 ePOS Print API Example To print while peeling the label one by one lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addFeedPosition builder FEED_CURRENT_TOF builder addBarcode 0001 builder BARCODE_CODE39 builder HRI_BELOW builder addFeedPosition builder FEED_PEELING gt lt script gt To print labels consecutively lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addFeedPosition builder FEED_CURRENT_TOF
94. ecifying the print g o 111 tion direction in page mode di Adds a tag f ifying the print addPagePosition aS z oe eee lea O Ns position in page mode addPageline Adds a tag for drawing a line in g e 115 page mode addPageRect Adds a tag for drawing a rectangle 5 C 117 angle in page mode Cut addCut Adds a tag for paper cut 0 119 Drawer kick adadPulse Adds a tag for the drawer kick out O 124 out Chapter 4 ePOS Print API San age Pa API Description dard pag mode ge mode Method Buzzer addSound Adds a tag for turning on the buzzer e 123 Adds the paper layout setup to Layout addLayout command buffer O 125 in firmware Ver 2 2 and later Recov Adds a tag for recovering from an R ery ARS cool error in firmware Ver 3 0 and later gt oa Reset Ss Adds a tag for resetting the printer r _ 131 in firmware Ver 3 0 and later Send Adds commands to the command Come gaoi nn buffer Sends ESC POS commands b S e mand Creat a oe Obtains a print document gener toString ated by on ePOS Print Builder e 133 Docu f object ment O Available Not available 61 62 IE E IN A Property Raster image halftone processing method halftone 134 in firmware Ver 1 2 and later Raster image brightness correction value brightness hee 135 in firm
95. ed gt lt script gt 171 interval property Specifies the interval of upgrading the status in firmware Ver 1 2 and later Object type Number Description The interval of upgrading the status is specified in milliseconas Default value 3000 three seconds Minimum value 1000 one second or longer When an invalid value is specified it is assumed to be 3000 Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer j var epos new epson CanvasPrint address epos interval 1000 epos oncoveropen function alert coveropen epos open gt lt script gt 172 Chapter 5 ePOS Print Canvas API status property Status of the printer in firmware Ver 1 2 and later Object type Number Description This is the status last obtained from the printer This is read only Default value O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onoffline function alert epos status di epos open gt lt script gt 173 battery property Battery sta
96. elect the paper width according to the operation method to be printed Automatic setting of paper layout A Turn the printer s power off and set the paper 2 While the cover is opened turn the power on while pressing the FEED button After confirming the ERROR LED lights up press the FEED button 6 times and close the cover In case of TM L90 i keep pressing the FEED button after the ERROR LED gets turned off once Q and lights up again 237 Rendering in HTML5 Canvas This section describes how to use Web pages using the ePOS Print Canvas API in the package You can try how to render images in HTML5 Canvas and see what images can be rendered The following Web pages are available Rendering Text canvas print text html p 239 Rendering Images canvas print image html p 241 Rendering Graphics canvas print graph html p 243 Rendering Hand written Images canvas print hand html p 245 Rendering Barcode canvas print barcode html p 247 Rendering Barcode canvas print barcode html p 247 how to place them refer to Environment Settings p 33 The Web pages introduced here are embedded into the sample program For the details about 238 Appendix Rendering Text canvas print text html Print text in HTML5 Canvas and perform a test print r A E Citing O O x 8 eson ePOS Print Sample i Le 93 Canvas Text Editing Hello World
97. eosin Aaa Gili a e 167 ClOSS Meta ta a 168 TECOVER IME INOG atrial a in adios 169 fESET method a A A A annie wink ida aia 169 Address prober s rta rl adas a nds 170 enabled propery vanna aa a E Ateos 171 interwal DIO DEM acosada 172 STOTUS OPE Va AA ii a 173 Battery DIODES Vis darla a ada datar dea lads 174 timeout proper itna 175 halftone PIO PSY anaona ida dt 176 Dl ht POPE Y ad 177 CUP DIODEMY asar aia id daa betas reee 178 mode Proper ans a wad ace rates ner iar a ieee ee ee as 179 COM PIOPEMY merean adi aan its Gave iis dea asa 180 COlOL PIODEMY O O O ies Miron anaa 181 feed DIODE eita a a a nice een ronan seine geet haart NE 182 paper propensa 183 lOYOUT POPE AV divas a Ita 184 ONTECENS Ur a AA A cl cama hens 189 OMEN Ol O NR 192 ONsTaTUsSCchaNGe SV daras 193 onb tterystatuschange Svent mia A i 194 ONbAMTESVOk CVERT ix aaa A Edda 195 onbattervlowS vent dad ida dadas 195 ONGOING VE A A a 196 Sno MNE VS Aaa ren o TO a aaa 196 ONPOWGEIOT Vii A A ie ied en nee 197 OME OVEIOKSVEMT fac raeme tripa da lea lada os Seas it ieee len polic as 197 ONCOVEIODEN Uri Radner as ed Re eee ee 198 ONPOPSIOK event sti cians oust dd Wud a di aed naa be ean o gaan iene 198 ONPAPEMearend SVEN Teint Aleta ieee Gh whiten iii 199 Onpaperendie vivida atan a ata 199 onarawercliosed veia taa 200 ONCIGWELOPESN OVEN iii bad da enna iaa 200 E ePOS Print Editor Operating Environment ooonoccconaccnoncccnnnoncncnnannnncnnnnnnnnnnnnnnnnn nn nana
98. equired parameter Object type Number Specifies the paper feed space in dots Specifies an integer from 0 to 255 Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example To feed paper by 30 dots lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addFeedUnit 30 gt lt script gt Chapter 4 ePOS Print API addFeedLine method Adds paper feeding in lines to the command buffer Syntax addFeedLine line Parameter e line Required parameter Object type Number Specifies the paper feed space in lines Specifies an integer from 0 to 255 Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example To feed paper by 3 lines lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addFeedLine 3 gt lt script gt 83 84 addFeedPosition method Adds label black mark paper feeding to the command buffer Supported in firmwar
99. ersion of ePOS Print supported TM printer or TMNet WebConfig of TM intelligent printer Timeout period Specifies the time to abort the process in milliseconas The timeout parameter is optional when it is omitted 60 seconds 60000 is set When the timeout period elapses the print job is canceled the data already interpreted by the printer before the start of the print abort process is printed 48 Chapter 3 Programming Guide Reception of Print Result The print result can be received by setting a callback function using the onreceive property p 148 of the ePOS Print object The following information is obtained A Print result A Error code A Printer status 2 The printer status can be obtained when communication with the printer is possible Refer to the following program For the details about how to program a callback function in detail refer to Error handling p 50 lt DOCTYPE html gt lt html gt lt head gt lt meta charset utf 8 gt lt title gt TITLE lt title gt lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt function buildMessage Create a print document var builder new epson ePOSBuilder builder addTextLang en builder addTextSmooth true builder addTextFont builder FONT_A builder addTextSize 3 3 builder addText Hello tWorld n builder addCut builder CUT_FEED var re
100. eseeieeeeeeee 17 Applications SAI Meca ada rodada bis R 17 TM daras 17 ePOS Print Supported IM printer a ion 17 PrintersThat Can Be ControllS luisa A aaa TO Siri 17 E System Construction Example 0 ccecccceccesseeeeeeeeeeseeeeeeeecesseeeeeeeessseeeeeeeeesseeaeeeeeeeseneneeess 18 Registering a Web Application Into the Web Server innniinininnicionnccicnninonnnonon cnn rnn rro ron rra rr ran 18 Registering a Web Application Into OTM i cic nr nen rro rro rr rr 19 Registering a Web application to Q CIOUC wi renner ieee 20 E Contents in the Package mmm ci 21 E Version ANTOMAT ON ii a A atin ak 23 E RESME BIOS iii dd TO R RRE 24 Sample Program ais ia mannanna nee 25 E Sample Program System Overview ooooococccccooocccoccconnoncncccnononannnnncnnnnnnnnnnnnnnnnnnannrnnnnnnnasnnnnos 25 Sample Progam UN daa 25 Print Image seia a Al aie A 27 A a E TE TA AATE EE 28 E Operating ENVIONMEN icon ic adaini 31 E nie aaah aa T ED 31 MiEnvironmentSStHINOS ioiaii id 33 Registration of Sample Program ePOS Print_API_UM_E_Sample zip oocicioocionocicononininncronanoninn nono 34 Network Setting of ePOS Print Supported TM Printer wo eerie 35 DevicS ID SSTINOS ii ds gear denne nd ear na al antes 37 sampleProgram SEMINGS iina Gye el Advts Haus Bea dadas 39 Programming Guide svaicy is ccsissasshencorsduc ease vannnastavrassentvauavaransmuscadess 41 DU EPOS PrintiAP le ois oo iors E aaa aaa 41 Print Mo diia aia 41 Programming HOW Y A Meet arenes
101. etting Common Sl E Alignment Center y x Text Printer Font E Image File on the Server Side m E i B la sio A J y Fi fa i Sample Shop Scale to Fit Paper Width Mode Monochrome Brightness 1 0 Text Paper Feed Color Monochrome Color 1 y Halftone Monochrome Error Diffusion y Image Lang ap Lo Thank you ln x Text Image NV Log Bar Code E Lines 2 x OD E wa Ete Orange n x ode ae I Page Mode Text FE Ti Mineral water n x g gt Text Start rea Direction Position LF Hoe Rect End E Alignment Left x Others D f al X Position 30 x 5 Total t t t t 1 000 n x D amp 1 HE Recovery Forced Transmission Ver 3 0 Import Clear Menu area Edit area tem PSN Menu area Displays the available functions Click an icon to add it to the bottom of the edit area and drag an icon to insert it anywhere in the edit area Edit area Displays the functions selected in the menu area Drag an element to change its position An element can be deleted using the x button located on its right side Import Using ePOS Print XML ePOS Print Editor can import XML data stored in the past For details refer to Import p 208 Clear Deletes the edited details Forced Transmission Sets forced transmission mode 204 Chapter 6 ePOS Print Editor Create a sample code as follows A Click an icon
102. event Registers a callback function to obtain a paper end event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onpaperend function alert paperend y epos open gt lt script gt 199 ondrawerclosed event Registers a callback function to obtain a drawer close event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos ondrawerclosed function alert drawerclosed Y epos open gt lt script gt ondraweropen event Registers a callback function to obtain a drawer open event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos
103. f characters false or O default Cancels emphasized printing of characters undefined Retains the current setting for emphasized print When not specified ing Chapter 4 ePOS Print API e color Optional parameter Object type String Specifies the color Description COLOR_NONE Characters are not printed COLOR_1 default First color COLOR_2 Second color COLOR_3 Third color COLOR_4 Fourth color undefined s Retains the current color setting When not specified Return value Return value 0 11 41013 ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example To set the underline style lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextStyle undefined true gt lt script gt 79 80 addTextPosition method Adds the horizontal print start position of text to the command buffer Syntax addTextPosition x Parameter e x Required parameter Object type Number Specifies the horizontal print start position in dots Specifies an integer from 0 to 65535 Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object ype Parameter is invalid
104. fy a print area to cover the content to be printed If the print data extends beyond the print area the print result will be such that the print data has been printed incompletely Use this API function by inserting it between addPageBegin p 107 and PageEnd p 108 A N Syntax addPageArea x y width height Parameter e x Required parameter Object type Number Specifies the origin of the horizontal axis in dots Specifies an integer from 0 to 65535 0 is the left end of the printer s printable area e y Required parameter Object type Number Specifies the origin of the vertical axis in dots Specifies an integer from 0 to 65535 0 is the position in which no paper feed has been performed e width Required parameter Object type Number Specifies the width of the print area in dots Specifies an integer from 0 to 65535 e height Required parameter Object type Number Specifies the height of the print area in dots Specifies an integer from 0 to 65535 Determine the width and height of the print area according to the print direction setting AN Otherwise the print data might not be printed completely Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error 109 Example To specify the print area with the origin 100 50 a width of 200 dots and a height of
105. geEnd p 108 Use this Q API function with PageEnd Syntax addPageBegin Return value Return value Object type ePOS Print Builder Object ePOS Builder Example To print the characters ABCDE in page mode lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addText ABCDE builder addPageEnd gt lt script gt 107 addPageEnd method Adds the end of page mode to the command buffer The page mode process ends Use this API function with addPageBegin p 107 Syntax addPageEnd Return value Object ype ePOS Print Builder Object ePOS Builder Example To print the characters ABCDE in page mode lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addText ABCDE builder addPageEnd gt lt script gt 108 Chapter 4 ePOS Print API addPageArea method Adds the print area in page mode to the command buffer Specifies the print area in page mode coordinates After this API function specify a print data API function such as the addText method Speci
106. he baseline for the first character This can be omitted for left aligned printing of standard sized characters To print double sized height characters specify a value equal to or greater than 42 for y To print a barcode Specify the bottom left of the symbol And specify the barcode height for y To print a graphic logo Specify the bottom left of the graphic data And specify the graphic data height for y To print a two dimensional symbol Specify the top left of the symbol This can be omitted when printing from the top left Return value Object ype ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error 113 Example To specify 50 30 for the print start position in the area specified by the addPageArea method and print the characters ABCDE lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addPageArea 100 50 200 100 builder addPagePosition 50 30 builder addText ABCDE builder addPageEnd gt lt script gt 114 Chapter 4 ePOS Print API addPageLine method Adds line drawing in page mode to the command buffer Draws a line in page mode Diagonal lines cannot be drawn Q Use this API function by inserting it between addPage
107. he command buffer Setting of page layout must be done in the standard mode In the page mode addLayout Q cannot be specified Syntax addLayout type width height margin_top margin_bottom offset_cut offset_label Parameter e type Required parameter Object type String Specifies the paper type Constant pe LAYOUT_RECEIPT Receipt without black mark LAYOUT_RECEIPT_BM Receipt with black mark LAYOUT_LABEL Die cut label without black mark LAYOUT_LABEL_BM Die cut label with black mark e width Optional parameter Object type Number When not specified 580 Specifies paper width in units of 0 1mm Specifies an integer from 290 to 600 e height Optional parameter Object type Number When not specified 0 Specifies paper height in units of 0 1mm Paper Type Valid value range Receipt tup not without black mark 5 id Distance from the top of Receipt with black mark black mark to the top of next black mark Die cut label O Auto Distance from the top of without black mark 284 to 1550 Manual label to the top of next label Distance from the bottom of black mark to the bottom of next black mark Die cut label with black mark 125 126 e margin _top e margin_bottom Optional parameter Object type e offset_cut Optional parameter Object type Number When not specified 0 Specifies top m
108. if asb epos ASB_DRAWER_KICK msg Status of the drawer kick number 3 connector pin H n if asb epos ASB_OFF_LINE msg Offline status n if asb epos ASB_COVER_OPEN msg Cover is open n if asb epos ASB_PAPER_FEED msg Paper feed switch is feeding paper n if asb epos ASB_WAIT_ON_LINE msg Waiting for online recoveryWn if asb epos ASB_PANEL SWITCH msg Panel switch is ON n if asb epos ASB_MECHANICAL_ERR msg Mechanical error generated n if asb epos ASB_AUTOCUTTER_ERR msg Auto cutter error generated n if asb epos ASB_UNRECOVER_ERR msg Unrecoverable error generated n if asb amp epos ASB_AUTORECOVER_ERR msg Auto recovery error generated n if asb epos ASB_RECEIPT_NEAR_END msg No paper in the roll paper near end detector n if asb amp epos ASB_RECEIPT_END msg No paper in the roll paper end detectorWn if asb epos ASB_BUZZER msg Sounding the buzzer limited model 1n if asb amp epos ASB_SPOOLER_IS_STOPPED msg Stop the spoolerin Display in the dialog box alert msg 57 Reception of Status Event The status event notification function is used to check the printer status without printing in firmware Ver 1 2 and later Refer to the following Set the end point
109. ilder MODE_MONO builder addTextLang en builder addText Thank you n builder addFeedLine 2 builder addText Orangen builder addText Mineral water n builder addFeed builder addTextAlign builder ALIGN_LEFT builder addTextPosition 30 builder addText Total t t t t 1 000 An var epos new epson ePOSPrint address epos onreceive function res alert res success epos onerror function err alert err status epos oncoveropen function alert coveropen epos send builder toString The ePOS Print XML print document is used for importing If necessary select the XML tab and save the content of the ePOS Print XML print document by copying 206 Chapter 6 ePOS Print Editor Using the printer print the print document according to the printer s settings to perform test printing For details on the printer settings refer to Setting p 203 Fr Erim Foo SS E Cid Dm O GX amp eos Print Editor x Edit Preview API XML Setting Data to be sent ePOS Print XML lt epos print xmins http www epson pos com schemas 2011 03 epos print gt S lt text align center gt lt image width 256 height 60 color color_1 mode mono gt AAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqAAAAAAAAABQAAAAA
110. in p 103 Syntax addVLineEnd x style Parameter e x Required parameter Object type Number Specifies the end position of the vertical line in dots Specifies an integer from 0 to 65535 e style Optional parameter Object type String Specifies the type of the line you want to finish drawing Constant vi LINE_THIN Solid line Thin LINE_MEDIUM Solid line Medium LINE_THICK Solid line Thick LINE_THIN_DOUBLE Double line Thin LINE_MEDIUM_DOUBLE Double line Medium LINE_THICK_DOUBLE Double line Thick undefined When not specified Solid line Thin Return value Return value 0119541913 ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error 105 Example To draw thin vertical lines at 100 dots and 200 dots from the left end lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addVLineBegin 100 addVLineBegin 200 builder addFeedUnit 100 builder addVLineEnd 100 addVLineEnd 200 gt lt script gt 106 Chapter 4 ePOS Print API addPageBegin method Adds the switching to page mode to the command buffer The page mode process starts Vertical lines are processed in page mode until their end is specified by Pa
111. in firmware Ver 1 2 and later cut Paper cut 178 161 162 IEC IE IS E E Property mode Color mode in firmware Ver 1 2 and later 179 align Position alignment 180 color Printing color 181 Control of label paper black mark paper feed 182 eS in firmware Ver 2 1 and later paper Type of papers in firmware Ver 2 1 and later 183 layout Paper layout in firmware Ver 2 2 and later 184 Event onreceive Response message receipt event 189 onerror Communication error event 192 Status change event tatusch 19 ASA in firmware Ver 1 2 and later i onbatterystatuschange Battery status change event 194 in firmware Ver 2 2 and later onbatteryok Battery OK event 195 in firmware Ver 2 2 and later onbatterylow Battery low event 195 in firmware Ver 2 2 and later ononline Online event in firmware Ver 1 2 and later 196 onoffline Offline event in firmware Ver 1 2 and later 196 Non response event ff 197 mea in firmware Ver 1 2 and later SL Cover close event 197 in firmware Ver 1 2 and later oncoveropen Covel een Oven 198 p in firmware Ver 1 2 and later Paper remaining event k 19 o in firmware Ver 1 2 and later a Paper near end event d 199 eee anne in firmware Ver 1 2 and later Paper end event 199 il in firmware Ver 1 2 and later Drawer close event d losed 20 ai in firmware Ver 1 2 and later u D t ondraweropen eee 200 in firm
112. ing Label CANVAS PrINT IADELATMD oo arranco 249 E Windows Store APPS ciane NE ia 251 sample Progam Screenin TA a 251 Environment of Sample Progra eers a a eiii 253 sample Program SSTINGS x isa 254 a E ONE a E A 255 10 Chapter 1 Overview Overview This chapter describes the features of and the specifications for ePOS Print Overview of ePOS Print ePOS Print is functionality to control POS printers in a multi platform environment From Web browser of computer smart phone and tablet printing can be directly done on ePOS Print supported TM printer In addition print images rendered in HTML5 Canvas can be printed ePOS Print provides the API for print commands When a print document Request is sent via HTTP from the host to the ePOS Print Service of a ePOS Print supported TM printer ePOS Print processes the printing of that document and returns a response document Response Web Server e Internet e Intranet e TM i web server Web Browser Web Page e HTML e CSS Request e Javascript ePOS Print supported TM printer cn ePOS Print AP ePOS Print Service a A SSS Response A IA 11 12 u O C 6 oo O As long as it is in a network environment a terminal with an HTML5 supported Web browser can perform printing from anywhere It supports Windows store apps JavaScript Installation of drivers and plug ins is not required No
113. int API addlmage method Adas raster image printing to the command buffer Prints graphics rendered in HTML5 Canvas Converts the specified range in a RGBA full color image of HTML5 Canvas into raster image data according to the settings of the halftone and brightness properties One pixel in an image equals to one printer dot When an image contains any transparent color the background color of the image is assumed to be white e To print a raster image at high speed specify ALIGN_LEFT for the addTextAlign method p Q 66 and specify a multiple of 8 not exceeding the printer s paper width for the width parameter of this API e In page mode a raster image is laid out in the current print position with the reference point being its bottom left dot The print position will not move If an HTML5 Canvas image contains images downloaded from different domains you cannot AN print the image In this case a security error occurs due to violation of the same origin policy of JavaScript Syntax addImage context x y width height color mode Parameter e context Required parameter Object type Context Specifies the 2D context of HTML5 Canvas e x Required parameter Object type Number Specifies the horizontal start position in the print area Specifies an integer from 0 to 65535 e y Required parameter Object type Number Specifies the vertical start position in the print area Specifies an integer from 0
114. le To send a 100msec pulse signal to the pin 2 of the drawer kick connector lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 7 function buildMessage var builder new epson ePOSBuilder builder addPulse builder DRAWER_1 builder PULSE_100 gt lt script gt 122 Chapter 4 ePOS Print API addSound method Adds the turning on of the buzzer to the command buffer Sets the buzzer e Not available in page mode AN e The buzzer function and the drawer cannot be used together e This API function cannot be used if the printer is not provided with the buzzer Syntax addSound pattern repeat cycle Parameter e pattern Optional parameter Object type String Specifies the buzzer pattern PATTERN_NONE Stop PATTERN_A Pattern A PATTERN_B Pattern B PATTERN_C Pattern C PATTERN_D Pattern D PATTERN_E Pattern E PATTERN_ERROR Error sound pattern PATTERN_PAPER_END Pattern when there is no paper PATERN_1 Pattern 1 in firmware Ver 2 2 and later PATERN_2 Pattern 2 in firmware Ver 2 2 and later PATERN_3 Pattern 3 in firmware Ver 2 2 and later PATERN_4 Pattern 4 in firmware Ver 2 2 and later PATERN_5 Pattern 5 in firmware Ver 2 2 and later PATERN_6 Pattern 6 in firmware Ver 2 2 and later PATERN_7 Pattern 7 in firmware Ver 2 2 and later PATERN_8 Pa
115. le line Thick undefined When not specified Solid line Thin Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error 117 118 Example To draw a rectangle with a thin double line with the start position 100 0 and the end position 500 200 as its vertexes lt script type text javascript lt script type text javascript gt lt function buildMessage var builder builder addPageBegin builder addPageLine 100 builder addPageEnd gt lt script gt 0 5 src epos print 3 x x js gt lt script gt new epson ePOSBuilder 00 200 builder LINE_THIN DOUBLE Chapter 4 ePOS Print API addCut method Adds paper cut to the command buffer Sets paper cut A Not available in page mode Syntax addCut type Parameter e type Optional parameter Object type String Specifies the paper cut type Cut without feeding CUT_NO_FEED The paper is cut without being fed Feed cut CUlEEED E The paper is fed to the cut position and then is cut Cut reservation CUT_RESERVE Printing continues until the cut position is reached at which the paper is cut undefined Feed cut When not specified The paper is fed to the cut position and then is cut Return value Return value
116. le smoothing print position Character style setting inversion of black and white underline bold Paper feed setting in dots in lines Image printing raster image NV graphics Barcode printing For barcodes that can be printed by each model refer to Printer specifications on page 209 Two dimensional symbol printing For two dimensional symbols that can be printed by each model refer to Printer specifications on page 209 Ruled line setting Control of label paper black mark paper Drawer kick function Buzzer function ESC POS command transmission Response document acquisition print result printer status system error status Paper layout setting Recovery from an error Reset Printing functions of ePOS Print Canvas API a a d a d al a Printing of images raster images rendered in HTML5 Canvas Control of label paper black mark paper Feed cut Response document acquisition print result printer status system error status Paper layout setting Recovery from an error Reset Chapter 1 Overview Operating Environment Applications environment 1 HTML5 supported Web browser e Windows Internet Explorer 9 or later e Mozilla Firefox 3 6 or later e Google Chrome 7 or later e Safari in OS4 0 or later e Standard browser in Android 2 2 or later 1 Windows Store apps e Javascript project Terminal Terminal with an HTML5 supported Web browser ePOS Print Supported TM printer TM i Series A
117. me image two color image Logo Bar Code Monochrome image two color image To perform two color printing change the settings of the printer using the memory switch setting utility UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE839 ITF CODABAR CODE93 CODE128 GS1 128 Two Dimensional Code PDF417 QR Code Ruled Line Not supported Paper Cut Cut Feed cut 213 80mm 58mm Specification of the paper feed position for labels black mark Not supported paper Drawer Kick Out Supported Buzzer Not supported Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 214 Appendix TM T70 i 80mm Interface Ethernet Wireless LAN Resolution 180 dpi x 180 dpi W x H Print Width 512 dots Font Font A Font B For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Line Font A ANK 42 characters Font B ANK 56 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 17 dots W x H Character Baseline Font A At the 21st dot from the top of the character Font B At the 15th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area 512 dots x 1662 dots W x H Page Mod
118. mission mode to use this API The printer recovers from errors that can be Q recovered from and clears the buffer Syntax addRecovery Return value Object ype ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example Recovers from errors that can be recovered from and clears the buffer lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder force true builder addRecovery gt lt script gt Chapter 4 ePOS Print API addReset method Adas the printer reset to the command buffer in firmware Ver 3 0 and later Q Other printing commands in the print document are ignored Syntax addReset Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example Resets the printer lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt l function buildMessage var builder new epson ePOSBuilder builder addReset gt lt script gt 131 addCommand method Adds commands to the command buffer Sends ESC POS commands ESC POS commands are no
119. mponents IE IN CS EI E lt firmware Ver 1 2 and later Constructor ePOS Print Initializes an ePOS Print object 138 Method send Sends a message 139 Enables status event operation open te 140 in firmware Ver 1 2 and later Disables status event operation close gt 141 in firmware Ver 1 2 and later Property URL of the printer 142 eddies in firmware Ver 1 2 and later Enabling disabling of status event 14 engied in firmware Ver 1 2 and later Printer status update interval int 144 Bees in firmware Ver 1 2 and later status Status 145 battery Battery status 146 timeout The connecting was timeout 147 Event onrecelve Response message receipt event 148 onerror Communication error event ISl Status change event 152 Onstaitecnangs in firmware Ver 1 2 and later i Battery status chenge event tusch E Se onde in firmware Ver 2 2 and later ononline Online event in firmware Ver 1 2 and later 153 onoffline Offline event in firmware Ver 1 2 and later 154 Non response event ff 154 di in firmware Ver 1 2 and later SL Cover close event 155 in firmware Ver 1 2 and later oncoveropen IO 155 p in firmware Ver 1 2 and later Paper remaining event k 156 sii in firmware Ver 1 2 and later ado medena Paper near end event 156 pap in firmware Ver 1 2 and later Paper end event onpaperend ee 157 63 64 CI O IA
120. nd sensor ASB_SPOOLER_IS_STOPPED ASB_BUZZER A buzzer is on only for applicable devices ASB_WAIT_REMOVE_LABEL Waiting for label to be removed only for applicable devices ASB_NO_LABEL No paper in label peeling sensor only for applicable devices The spooler has stopped Not used 149 e Value of battery Status of power value batery Ox30XX The AC adapter is connected Ox31XX The AC adapter is connected Remaining battery value batery OxXX36 Battery amount 6 OxXX35 Battery amount 5 OxXX34 Battery amount 4 OxXX33 Battery amount 3 OxXX32 Battery amount 2 OxXX31 Battery amount 1 Near end OxXX30 Battery amount 0 Real end Q 0 is shown when the model doesn t have a battery installed Example To create and send a print document To display the print result in a message box lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function printHellowWorld var builder new epson ePOSBuilder builder addText Hello World n builder addCut var request builder toString var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onreceive function res var success res success var code res code var status res status alert success epos send reque
121. ntifier GS1 128 Al and data The spaces are used as HRI print characters and are not encoded as data To encode each of the following characters specify two characters starting with the character FNC1 q FNC3 3 JE D t GS1 DataBar Omnidi rectional Specify a 13 digit global trade item number GTIN not GS1 DataBar Truncated including an application identifier Al or a check digit GS1 DataBar Limited 91 Barcode type You can enclose an application identifier Al in parentheses The parentheses are used as HRI print characters and are not encoded as data To encode each of the following characters specify two characters starting with the character BARCODE_GS1_ DATABAR_EXPANDED 92 e type FNC1 1 0 To specify binary data that cannot be represented by character strings use the following escape sequences Ping NI xnn Control code Back slash Required parameter Object type String Specifies the barcode type Constant type Barcode type BARCODE_UPC_A UPC A BARCODE_UPC_E UPC E BARCODE_EAN13 EAN13 BARCODE_JAN13 JAN13 BARCODE_EAN8 EAN8 BARCODE_JAN8 JAN8 BARCODE_CODE39 CODE39 BARCODE_ITF ITF BARCODE_CODABAR CODABAR BARCODE_CODE93 CODE93 BARCODE_CODE128 CODE128 BARCODE_GS1_128 6S1 128 BARCODE_GS1_DATABAR_OMNIDIRECTIONAL GS1 DataBar Omnidirectional BARCODE_GS1_D
122. nual that came with the printer Characters in a Line Font A ANK 42 characters Font B ANK 56 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 17 dots W x H Character Baseline Font A At the 21st dot from the top of the character Font B At the 16th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area 512 dots x 831 dots W x H Page Mode Maximum Area 512 dots x 1662 dots W x H Raster image Monochrome image two color image Logo Monochrome image two color image Bar Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE839 ITF CODABAR CODE93 CODE128 6S1 128 6S1 DataBar Omnidirectional 6S1 DataBar Truncated 6S1 DataBar Limited GS1 Databar Expanded Two Dimensional Code PDF417 QR Code MaxiCode GS1 DataBar Stacked GS1 DataBar Stacked Omnidirectional 6S1 DataBar Expanded Stacked Composite Symbology not supported 209 80mm Ruled Line Not supported Paper Cut Cut Feed cut Specification of the paper feed position for labels black mark Not supported paper Drawer Kick Out Supported Buzzer Optional Pattern A Pattern E Error No paper Stop Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 210 Appendix TM T88V 80mm 58mm Interface Ethernet Wireless LAN
123. nvas API e Value of margin_top Object type Number When not specified 0 Specifies top margin in units of 0 1mm Paper Type Valid value ronge with black mark Receipt 0 Setup not necessary without black mark mel Meee eens 150 to 1500 aoa from the top of black Die cut label O to 1500 Distance from the top of label without black mark Die cut label 15 to 1500 Distance from the bottom of black mark e Value of margin_bottom Object type Number When not specified 0 Specifies bottom margin in units of 0 1mm Paper Type Vall value range Die cut label with black mark Receipt 0 Setup not necessary without black mark Receipt with black mark 0 15to 0 Distance from the bottom of PIRASA label paper feed direction is a without black mark a positive number 15to 15 Distance from the top of black mark paper feed direction is a positive number e Value of offset_cut Object type Number When not specified 0 Specifies cut position in units of 0 1mm In case of die cut label paper it is a distance from the bottom of label When a paper has black mark it is a distance from the beginning of black mark Paper type Valid value range with black mark Receipt 0 Setup not necessary without black mark 290 to 50 Distance from the top of black Receipt with black mark mark to the top of next black mark Die cut label Oto 50
124. o set 58mm die cut label with black mark lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos paper epos PAPER_LABEL_BM epos layout width 580 height 0 margin_top 15 margin_bottom 15 offset_cut 25 offset_label 15 epos cut true epos print canvas gt lt script gt 188 Chapter 5 ePOS Print Canvas API onreceive event This property registers the callback function and obtains a response message receipt event Syntax Function response Parameter of the callback function Parameter response See Properties of the response object on page 189 Name Response message Object type Object Properties of the response object P Parameter J Name Object ype success p 189 Print result Boolean code p 189 Error code String status p 190 Status Number battery p 190 Battery status Number e Value of success true or 1 Printing succeeded false or O Printing failed e Value of code Value EPTR_AUTOMATICAL An automatically recoverable error occurred EPTR_COVER_OPEN A cover open error occurred EPTR_CUTTER An autocutter error occurred
125. ogo Setup Utility TMFLogo TMNet WinConfig EpsonNet Config Chapter 1 Overview Version Information Version of ePOS Print Service installed on a printer can be confirmed as follows Confirmation Method ePOS Print Version lt TM i Series gt lt Example gt e TM T88V i e Displayed on EPSON TMNet WebConfig 2 0xWW Ver 2 0 e TM T70 i e Printed on the status sheet 2 1XWW Ver 2 1 e TM L90 i lt TM Printer Wireless LAN Model gt DS a 4 Reece lt Example gt TM P60lI isplaye En psonNet Config NO Web version e TM P6OIl with Peeler If API of newly added ePOS Print Builder is used on unsupported models schema error is AN returned and printing cannot be done The latest version of ePOS Print API JavaScript is recommended regardless of ePOS Print Service version installed on a printer ePOS Print API JavaScript is bundled with the sample program For details refer to Contents in the Package on page 21 23 Restrictsions 24 1 The drawer and the buzzer cannot be used together The buzzer function cannot be used if the printer is not provided with the buzzer AU Internet Explorer 9 does not allow printing to the printer to be performed from security protected Web pages HTTPS 1 When multiple tones are set for raster images intermitting printing may occur because the amount of data to print increases and white stripes may appear in the print result in firmware Ver
126. on Cut Paper When this item is selected feed cut is performed after printing Set the paper layout Check when printing labels with paper layout specified Layout Specify the label paper layout Setting become effective when Set the paper layout is checked 5 The print result is displayed 250 Appendix Windows Store Apps In this section how to use the sample program with Windows store apps is described Sample Program Screen Display the Sample screen Executes printing It can print the following ePOS Print Demo Description Display the Sample screen Executes printing It can print the following 1 Samples Queue Ticket 253 e Coupon e Label Display the Settings screen Set up the following e Specifies the IP address of the ePOS Print supported printer Default value 192 168 192 168 e Specifies the Device ID of the printer to print queue ticket numbers a and coupons Default value local_printer 2 Settings DA gt 254 e Specifies the timeout time default 60000 e Prints coupons in gray scale Only for supported models Default No e Specifies paper layout and print Only for TM P60Il Peeler Default No 251 Print Image Your Number ePOS Print API Sample Shop Matsumoto Nagano Your Number 0001 Please A until ya ur ticket umber is called Mon Aug 01 2011 16 18 00 0001 Label ePOS Print API Name tem A Color
127. or printing amp timeout timeout time Mode Set the color mode Monochrome Grayscale Brightness Adjust the brightness Gamma value in the range 0 1 10 0 Halftone Set the halftone processing method for monochrome printing two tone Cut Paper When this item is selected feed cut is performed after printing Alignment Specify the printing position alignment Color Monochrome Specify the printing color in 2 tone The print result is displayed Appendix Rendering Label canvas print label html Draw a label in HTML5 Canvas and perform a test print r 1 8 z O ax eros print Sample Prog Lua Canvas Label Editing Name Name Description Description Name T Description 201234567890 20123 890 456789 Price 19 80 Test Print URL hittp 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Mode Monochrome x Brightness 1 0 Halftone Monochrome Threshold Alignment Left z Color Monochrome Color 1 x a Paper Die Cut Label Paper x Feed to Peeling x D Cut Paper C Set the paper layout Layout width 580 height O margin_top 15 margin_bottom 15 offset_cut 25 offset_label 0 A Open the following URL page using the Web browser http Web server IP address canvas canvas print label html 2 EPSON ePOS Print S
128. orced Transmission Ver 3 0 Import Clear 202 Chapter 6 ePOS Print Editor Setting Perform the print setting and the preview setting Select the Setting tab to display the Setting screen Pos lt e e P e x 2 ePOS Print Editor NATA Edit Preview API XML Print Setting Preview Model Paper width Liner width TM T88V i 80mm Print IP address of ePOS Print supported printer 192 168 192 168 Device ID of the target printer local_printer Print timeout milliseconds 60000 Monitor the status Description Model Paper width Liner width Select printer model to be used and paper width for label paper the mount width The Preview screen resizes according to the paper width set to the model IP address of ePOS Print supported TM Specify the IP adaress of the printer printer Be sure to specify this item Device ID of the target printer Specify the device ID of the printer Be sure to specify this item Print timeout milliseconds Specify the print timeout time in milliseconds The maximum value is 60000 60 seconds Monitor the status When this checkbox is checked the printer s status is monitored 203 Creating a Sample Code Select the Edit tab to display the Edit screen Create an ePOS Print API sample code in the Edit screen r JZE 7 E perme O X epos print Editor i Edit Preview API XML Print S
129. orrection level 7 LEVEL_8 PDF417 error correction level 8 LEVEL_L QR Code error correction level L LEVEL_M QR Code error correction level M LEVEL_Q QR Code error correction level Q LEVEL_H QR Code error correction level H LEVEL_DEFAULT Default level Aztec Code error correction level Default 23 POIS STE in firmware Ver 2 2 and later e Select the level according to the two dimensional symbol type Q e For MaxiCode and two dimensional GS1 DataBar select LEVEL_DEFAULT e width Optional parameter Object type Number Specifies the module width Specifies an integer from 0 to 255 2D Code type Valid value range Default value PDF417 2to 8 3 QR Code lto 16 3 MaxiCode Ignored 2D 6S1 Databar 2108 2 Aztec Code 2to 16 3 DataMatrix 2to 16 3 Chapter 4 ePOS Print API e height Optional parameter Object type Number Specifies the module height Specifies an integer from 0 to 255 2D Code type Valid value range Default value 2to 8 Pero Magnification for width QR Code MaxiCode 2D 6S1 Databar Ignored Aztec Code DataMatrix e size Optional parameter Object type Number Specifies the two dimensional symbol maximum size Specifies an integer from 0 to 65535 2D Code type Default value PDFAI7 0 Auto Specifies the number of code words for each row QR Code Ignored MaxiCode Specifies the maximum 2D GS1 Databar O Auto width for
130. osition of the horizontal line in dots Specifies an integer from 0 to 65535 e x2 Required parameter Object type Number Specifies the end position of the horizontal line in dots Specifies an integer from 0 to 65535 e style Optional parameter Object type String Specifies the line type LINE_THIN Solid line Thin LINE_MEDIUM Solid line Medium LINE_THICK Solid line Thick LINE_THIN_DOUBLE Double line Thin LINE_MEDIUM_DOUBLE Double line Medium LINE_THICK_DOUBLE Double line Thick undefined When not specified Solid line Thin Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error 101 102 Example To draw double horizontal lines in the following positions e Between 100 dots and 200 dots from the left end e Between 400 dots and 500 dots from the left end lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addHLine 100 200 builder LINE_THIN DOUBLE builder addHLine 400 500 builder LINE_THIN DOUBLE gt lt script gt Chapter 4 ePOS Print API addVLineBegin method Adds the beginning of vertical line to the command buffer Starts to draw vertical lines Not available in page mode Q Vertical lines are drawn until
131. p EpsonNet Config Double click on the printer s EpsonNet Config i Refresh z Configuration 5 Launch Browser Filter USB connected devices Model Name MAC Address IP Address YD TM Printer bdo b i sammi MUN ARLE Configure the Network settings and the TCP IP settings Disconnect the USB cable turn off the printer and then turn it back on Chapter 2 Sample Program Device ID Settings A TM i p 37 1 TM Printer for Wireless LAN Model p 38 TM i Set the Device ID of the printer to be controlled by ePOS Print into the TM i Use TMNet WebConfig to set the Device ID Q In the sample program Device ID Settings are not required Refer to it if necessary je EPSON TMNet WebConfi x Check Device ID Model TP Address Retry Interval ms Test Print Lasa nr metas 100 Configure the settings according to the following procedure A Connect all the printers to the network and turn their power ON 2 Start the Web browser and enter the IP address set in Network Setting of ePOS Print Supported TM printer p 35 3 TMNet WebConfig starts Select as Configuration Device 37 38 5 The Device Settings screen appears Set the following and click Register Description Device ID Specifies the ID to identify the printer to be controlled by ePOS Print Model Specifies the model of
132. pe text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos oncoverok function alert coverok Y epos open gt lt script gt oncoveropen event Registers a callback function to obtain a cover open event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt gie var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos oncoveropen function alert coveropen Y epos open gt lt script gt 155 156 onpaperok event Registers a callback function to obtain a paper remaining event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onpaperok function alert paperok Y epos open gt lt script gt src epos print 3 x x js gt lt script gt onpapernearend event Registers a callback function to obtain a paper near end event in firmware Ver 1 2 and later Object type Function O
133. ported Page Mode Default Area 420 dots x 1200 dots 432 dots x 1200 dots 400 dots x 1200 dots WxH WxH WxH 231 Page Mode Maximum Area Receipt 58mm Receipt 60mm 420 dots x 1200 dots 432 dots x 1200 dots Die cut label 400 dots x 1200 dots W x H W x H W x H Page Mode Line Supported Only solid line Rectangle Paper Cut Feed cut Feeds paper to cutting position Specification of the paper feed position for labels black mark Supported paper Drawer Kick Out Not supported Buzzer Support Pattern1 Pattern 10 Stop Paper Layout Settings Supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 232 Appendix TM T20 58mm 80mm Interface Ethernet Resolution 203 dpi x 203 dpi W x H Print Width 420 dots 576 dots Font Font A Font B For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Font A ANK 35 characters ANK 48 characters Line Font B ANK 46 characters ANK 64 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 17 dots W x H Character Font A At the 21st dot from the top of the character Baseline Font B At the 16 st dot from the top of the character Default Line Feed Space 30 dots Color Specification Fir
134. print image html 2 EPSON ePOS Print Sample Program appears Set items on the right of the page The following items can be set Description Position Specify the rendering coordinates Size Specify the width and height of the image Angle Specify the rotation angle of the image The rotation angle is counted clockwise from the top left corner Image File Specify the path to the image file in the same server In this Web page specify the name of an image file placed under the same directory as this Web page Clear Clears the image drawn in the Canvas Reset Clears the image drawn in the Canvas In addition the settings are reset to their default values 241 4 5 242 Click the Draw button The image is drawn on Canvas on the left of the page according to the settings made on the right of the page Set the following and click the Print button URL Enter the following URL http IP address of ePOS Print supported TM printen cgi bin epos service cgi devid device ID of printer to be used for printing amp timeout timeout time Mode Set the color mode Monochrome Grayscale Brightness Adjust the brightness Gamma value in the range 0 1 10 0 Halftone Set the halftone processing method for monochrome printing two tone Cut Paper When this item is selected feed cut is performed after printing Alignment Specify the printing position alignment Color Monochrome Specify
135. quest builder toString var address http 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Create an ePOS Print object var epos new epson ePOSPrint address Set a response receipt callback function epos onreceive function res When the printing is not successful display a message if res success alert A print error occurred Send the print document epos send request Print result receipt callback function lt script gt lt head gt lt body gt lt button onclick buildMessage gt Run lt button gt lt body gt lt html gt 49 50 Error handling Refer to the following program for the error handling method by a callback function msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg if asb msg alert msg Create an ePOS Print object var epos new epson ePOSPrint address Set a response receipt callback function epos onreceive function res Obtain the print result and error code var msg Print res success Success Failure nCode res code nStatus n Obtain the printer status var asb res status if asb amp epos ASB_NO
136. r CUT_FEED Acquire the print document var request builder toString alert request lt script gt lt head gt lt body gt lt button onclick buildMessage gt Run lt button gt lt body gt lt html gt To create a text print document Chapter 3 Programming Guide To create a text print document store the font settings into the command buffer using text methods and then create a print document Refer to the following program For the string Hello World to create a print document based on the following settings A Font FontA 1 Scale x 4 horizontal and x 4 vertical q Style Bold lt script type text javascript gt function buildMessage Create an ePOS Print Builder object var builder new epson ePOSBuilder Create a print document lt Configure the print character settings gt builder addTextLang en builder addTextSmooth true builder addTextFont builder FONT_A builder addTextSize 4 4 lt Specify the print data gt builder addText Hello tWorld n builder addCut builder CUT_FEED Acquire the print document var request builder toString lt script gt lt script type text javascript src epos print 3 x x js gt lt script gt builder addTextStyle false false true undefined 45 46 To create a graphic print document To create a graphic print document store a raster image obtained
137. r Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 Two Dimensional Code PDF417 QR Code Ruled Line Not supported Paper Cut Cut Feed cut t A E a Netsuppered Drawer Kick Out Supported Buzzer Not supported Paper Layout Settings Not supported 217 80mm Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 218 Appendix TM T70 80mm Interface Ethernet Wireless LAN Resolution 180 dpi x 180 dpi W x H Print Width 512 dots Font Font A Font B For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Line Font A ANK 42 characters Font B ANK 56 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 17 dots W x H Character Baseline Font A At the 21st dot from the top of the character Font B At the 15th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area 512 dots x 1662 dots W x H Page Mode Maximum Area 512 dots x 1662 dots W x H Raster image Monochrome image Logo Monochrome image Bar Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 Two Dimensional Code PDF417 QR Code Ruled Line Not supported Paper Cut Cu
138. ress canvas canvas print hand html 2 EPSON ePOS Print Sample Program appears Set the size of the pen on the right of the page 3 Draw a freehand line on Canvas on the left of the page For the mouse drag it to draw a line for the touch screen monitor draw a line on the touch screen To erase the drawn image click the Clear button 245 4 Set the following and click the Print button A A A IE URL Enter the following URL http IP address of ePOS Print supported TM printen cgi bin epos service cgi devid device ID of printer to be used for printing amp timeout timeout time Mode Set the color mode Monochrome Grayscale Brightness Adjust the brightness Gamma value in the range 0 1 10 0 Halftone Set the halftone processing method for monochrome printing two tone Cut Paper When this item is selected feed cut is performed after printing Alignment Specify the printing position alignment Color Monochrome Specify the printing color in 2 tone 5 The print result is displayed 246 Appendix Rendering Barcode canvas print barcode html Draw a barcode in HTML5 Canvas and perform a test print In the following example an EAN13 JAN13 or UPC A is drawn r Cita O O X G EPSON ePOS Print Sample fy Ys 293 Canvas Bar Code Editing Position x5 y 175 Module Size w3 h162 IEAN13 JAN13 Data
139. rint address epos onbatterylow function alert batterylow Y epos open gt lt script gt src epos print 3 x x js gt lt script gt 159 160 Chapter 5 ePOS Print Canvas API ePOS Print Canvas API This chapter describes the ePOS Print Canvas API List of ePOS Print Canvas API functions The ePOS Print Canvas API provides the following object 1 ePOS Print Canvas API window epson CanvasPrint object p 161 window epson CanvasPrint Components IEC IE IS EI E Constructor CanvasPrint Initializes an ePOS Print Canvas API object 164 method print Prints an HTML5 Canvas image 165 Enables status event operation open a 167 in firmware Ver 1 2 and later Disables status event operation close ae 168 in firmware Ver 1 2 and later ee Recovers from an error 169 in firmware Ver 3 0 and later Resets the printer 169 Sl in firmware Ver 3 0 and later E Property URL of the printer 17 gades in firmware Ver 1 2 and later Bid Enabling disabling of status event 171 in firmware Ver 1 2 and later atonal Printer status update interval 172 in firmware Ver 1 2 and later status Status in firmware Ver 1 2 and later 173 battery Battery status 174 timeout Connection timeout 175 PIETE Rasiei image halftone processing method 176 in firmware Ver 1 2 and later f Raster image brightness correction value 177 Anghines
140. rty It sets paper feed of label paper black mark paper in firmware Ver 2 1 and later Object type String Description Paper feed position of label paper black mark paper FEED_PEELING Feeds to the peeling position FEED_CUTTING Feeds to the cutting position FEED_CURRENT_TOF Default Feeds to the top of the current label FEED_NEXT_TOF Feeds to the top of the next label Example After printing a label it feeds paper to the peeling position lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos paper epos PAPER_LABEL epos feed epos FEED_PEELING epos print canvas gt lt script gt 182 Chapter 5 ePOS Print Canvas API paper property It sets paper type in firmware Ver 2 1 and later Object type String Description It specifies paper type PAPER_RECEIPT Default Receipt without black mark PAPER_RECEIPT_BM Receipt with black mark PAPER_LABEL Die cut label without black mark PAPAER_LABEL_BM Die cut label with black mark Example Prints a label lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var a
141. s var address http 192 168 192 168 cgi bin epos service cgi devid 1o0cal_printer amp timeout 10000 Create an ePOS Print Builder object var builder new epson ePOSBuilder address Set an event callback function cover open epos oncoveropen function alert coveropen Set an event callback function paper near end epos onpapernearend function alert papernearend Enable status event operation epos open 51 ePOS Print Canvas API For the ePOS Print Canvas API programming is performed based on the following work flow 52 1 Embedding of ePOS Print Canvas API p 53 2 Rendering in HTML5 Canvas p 54 3 Prints an Canvas image p 55 4 Reception of Print Result p 56 O e ePOS Print supported TM printer starts printing after checking the status of TM printer e A status event helps check the status of the TM printer For details on the procedure refer to Reception of Status Event p 51 Chapter 3 Programming Guide Embedding of ePOS Print Canvas API The ePOS Print Canvas API is provided as JavaScript And its file name is epos print 3 x x js It is used by embedding epos print 3 x x js into applications Preparation To use the ePOS Print Canvas API place epos print 3 x x js on the Web server Embedding into Web pages Embed the script into the Web page by using the HTML lt script gt tags lt DOCTYPE html gt lt html g
142. s gt lt script gt Thttp 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementBylId myCanvas var epos new epson CanvasPrint address epos paper epos PAPER_RECEIPT epos layout width 580 epos cut true epos print canvas gt lt script gt To set 58mm receipt with black mark lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos paper epos PAPER_RECEIPT_BM epos layout width 580 height 0 margin_top 15 offset_cut 0 epos cut true epos print canvas gt lt script gt To set 58mm die cut label without black mark lt script type text javascript lt script type text javascript gt lt var address src epos print 3 x x js gt lt script gt http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos paper epos PAPER_LABEL epos layout width 580 height 0 margin_top 15 offset_cut 25 margin_bottom 15 epos cut true epos print canvas gt lt script gt 187 T
143. s into the command buffer to create print data For the end of page mode store the PageEnd method into the command buffer For the string Hello World to create a print document based on the following settings lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt function buildMessage Create an ePOS Print Builder object var builder new epson ePOSBuilder Create a print document lt The page mode starts gt builder addPageBegin lt Specify the page mode print area gt builder addPageArea 100 50 200 100 lt Specify the page mode print position gt builder addPagePosition 0 42 lt Specify the print data gt builder addTextLang en builder addTextFont builder FONT_A builder addTextSize 4 4 builder addTextStyle false false true undefined builder addText Hello tWorld n lt The page mode ends gt builder addPageEnd builder addCut builder CUT_FEED Acquire the print document var request builder toString lt script gt 47 Transmission of Print Document A print document is sent using an ePOS Print object Create an ePOS Print object using the constructor and specify the end point address for the printer to be used for printing as well as the print document into the send method to send the document For the details about the printer end point adaress refer to Printer End Point Addre
144. s specified the 8th digit is pro cessed as a check digit but the check digit is not vali dated CODE39 When the first character is the character is processed as the start character In other cases a start character is automatically added ITF Start and stop codes are automatically added Check digits are not added or validated Chapter 4 ePOS Print API Barcode type Specify a start character A to D a to d CODABAR Specify a stop character A to D a to d Check digits are not added or validated Start and stop characters are automatically added CODE93 A check digit is automatically calculated and added Specify a start character CODE A CODE B CODE C A stop character is automatically added A check digit is automatically calculated and added To encode each of the following characters specify two characters starting with the character FNC1 1 FNC2 2 CODE128 ENC3 3 FNC4 4 CODE A A CODE B B CODE C C SHIFT S A start character FNC1 a check digit and a stop character are automatically added To automatically calculate and add a check digit for an application identifier Al and the subsequent data specify the character in the position of the check digit You can enclose an application identifier Al in parentheses The parentheses are used as HRI print characters and are not encoded as data You can insert soaces between an application ide
145. script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos oncoveropen function alert coveropen Y epos open gt lt script gt onpaperok event Registers a callback function to obtain a paper remaining event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onpaperok function alert paperok y epos open gt lt script gt 198 Chapter 5 ePOS Print Canvas API onpapernearend event Registers a callback function to obtain a paper near end event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onpapernearend function alert papernearend Y epos open gt lt script gt onpaperend
146. setting addTextSize Adds a tag for the text scale setting O O Vi adaTextStyle Adds a tag for the text style setting O O 78 SN o 20 position of text Adds a tag for specifying the print adaTextVPosition vertical position of text e 81 in firmware Ver 3 0 and later 59 60 Method Stan dae Vpa API Description dard pag mode ge mode addFeedUnit Adds a tag for paper feeding in e Ps 80 cots addresaline o a tag for paper feeding in A 83 Paper lines Feed addFeedPosition Adds control of label paper black e g 84 mark paper to command buffer oea Adds a line feed to the command e 86 buffer P adanogs Adas a tag for a raster image to be m m 87 Graphi printed C A tag f NVI t ae alec ees a tag for an ogo to be e C 80 printed dddbarcods nads a tag for a bar code to be e 90 Bar printed code A tag for a two di ional cereal dds a tag ot a two dimensiona o e 95 code to be printed addHlLine AAR a tag for a horizontal line to be g 101 dls printed a addVLineBegin Adds a tag for starting a vertical line e 103 addVLineEna nads a tag for finishing a vertical e g 105 line A tag f itching t ARCB dds a tag for switching to page 107 mode addPageEnd Adds a tag for finishing page mode O 108 A tag f ifying th int ages ies cebe ag for specifying the prin p 109 area in page mode Page Anar ogeDIrec RE i tag for sp
147. ss Device Control AA Network d Terminal Executes the Web application using a browser 1 TM Printer Wireless LAN Model 20 Contents in the Package Manual SampleProgram ePOS Print_API_UM_E_Sample zip The following are included a a a a canvas canvas pr canvas canvas pr canvas canvas pr canvas canvas pr canvas canvas pr canvas canvas pr d ePOS Print API User s Manual This Document d ePOS Print XML User s Manual 1 TM T88V i Technical Reference Guide 4 TM T70 i Technical Reference Guide TM L90 i Technical Reference Guide 4 TM P 60I Technical Reference Guide d epos print 3 x x js ePOS Print JavaScript for embedding sample index html Sampleprogram editor index html ePOS Print Editor win8 ePOS Print Demo zip Windows Store apps sample program Rendering in HTML5 Canvas int text html Rendering text int image html Rendering images int graph html Rendering graphics int hand html Rendering handwritten images int barcode html Rendering barcode int label html Rendering label Chapter 1 Overview 21 Utility T TM i Series Utility TM T88V i TM T70 i TM L90 i Model Dedicated Utility O Memory Switch Setting Utility O TM Flash Logo Setup Utility o TMFLogo TMNet WinConfig EpsonNet Config i 1 TM Printer Wireless LAN Model Utility TM P60I Model Dedicated Utility O Memory Switch Setting Utility TM Flash L
148. ss http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onoffline function alert offline Y epos open gt lt script gt 196 Chapter 5 ePOS Print Canvas API onpoweroff event Registers a callback function to obtain a non response event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onpoweroff function alert poweroff y epos open gt lt script gt oncoverok event Registers a callback function to obtain a cover close event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos oncoverok function alert coverok y epos open gt lt script gt 197 oncoveropen event Registers a callback function to obtain a cover open event in firmware Ver 1 2 and later Object type Function O Example lt
149. ss p 48 Refer to the following program lt DOCTYPE html gt lt html gt lt head gt lt meta charset utf 8 gt lt title gt TITLE lt title gt lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt function buildMessage Create a print document var builder new epson ePOSBuilder builder addTextLang en builder addTextSmooth true builder addTextFont builder FONT_A builder addTextSize 3 3 builder addText Hello tWorld n A builder addCut builder CUT_FEED Transmission of print document var request builder toString ra Set the end point address var address http 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Create an ePOS Print object var epos new epson ePOSPrint address Send the print document epos send request lt script gt lt head gt lt body gt lt button onclick buildMessage gt Run lt button gt lt body gt lt html gt Printer End Point Address Specify the printer end point address in the following format http domain cgi bin epos service cgi devid device ID amp timeout timeout time Items to specify Description Domain Specify IP address or domain of ePOS Print supported TM printer Device ID Specifies the printer to be used for printing Specify device ID registered with EpsonNet Config Web v
150. st gt lt script gt 150 Chapter 4 ePOS Print API onerror event This property registers the callback function and obtains a communication error event Syntax Function error Parameter of the callback function Parameters error See Properties of the error object on page 151 Name Communication error information Object type Object Properties of the error object property Name Object ype status HTTP Status Number responseText Response text String Example To create and send a print document To display the HTTP status code in a message box when a communication error occurs lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function printHellowWorld var builder new epson ePOSBuilder builder addText Hello World n builder addCut var request builder toString var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onerror function err var status err status var text err responseText alert status epos send request gt lt script gt 151 onstatuschange event Registers a callback function to obtain a status change event in firmware Ver 1 2 and later Syntax Function status Parameter of the callback function Parameters status
151. st color Raster Image Monochrome image Logo Monochrome image Bar Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 6S1 128 GS1 DataBar Omnidirectional GS1 DataBar Truncated 6S1 DataBar Limited 6S1 DataBar Expanded Two Dimensional Code PDF417 QR Code MaxiCode 6S1 DataBar Stacked 6S1 DataBar Stacked Omnidirectional GS1 DataBar Expanded Stacked Composit Symbology Not supported Ruled Line Not supported Page Mode Default Area 420 dots x 831 dots W x H 576 dots x 831 dots W x H Page Mode Maximum Area 420 dots x 1662 dots W x H 576 dots x 1662 dots W x H Page Mode Line Not supported Rectangle Paper Cut Cut Feed cut 233 58mm 80mm Specification of the paper feed position for labels black mark Not supported paper Drawer Kick Out Supported Buzzer Optional Pattern A Pattern E Error No paper Stop Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 234 Appendix TM U220 76mm 70mm 58mm Interface Ethernet Wireless LAN Resolution 80 dpi x 72 dpi W x H Print Width 200 dots 180 dots 150 dots Font Font A Font B For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Font A ANK 33 charac
152. t Chapter 4 ePOS Print API enabled property Retains the enabled disabled setting for status event operation in firmware Ver 1 2 and later Object type Boolean Description The enabled disabled setting for status event operation is retained using a logical value This is read only The default value is false Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos oncoveropen function alert coveropen epos open alert epos enabled gt lt script gt 143 interval property Specifies the interval of upgrading the status in firmware Ver 1 2 and later Object type Number Description The interval of upgrading the status is specified in milliseconas Default value 3000 three seconds Minimum value 1000 one second or longer When an invalid value is specified it is assumed to be 3000 Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos interval 1000 epos oncoveropen function alert coveropen epos open gt
153. t heads Embed lt meta charset utf 8 gt lt title gt TITLE lt title gt lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt function drawCanvas lt script gt lt head gt lt body gt lt body gt lt html gt 53 54 Rendering in HTML5 Canvas Render an image in HTML5 Canvas lt DOCTYPE html gt lt html gt lt head gt lt meta charset utf 8 lt title gt TITLE lt title gt lt script type text javascript lt script type text javascript gt gt Rendering in HTML5 Canvas src epos print 3 x x js gt lt script gt function drawCanvas Rendering in HTML5 Canvas lt Obtain the context gt var canvas document getElementById myCanvas var context canvas getContext 2d lt Render an image gt context clearRect 0 0 512 480 context drawImage document getElementBylId coffee 512 384 context fillStyle rgba 255 255 context fillRect 0 0 512 480 context fillStyle rgba 0 0 0 1 0 lt Render a water mark for the image gt context drawImage document getElementBylId wmark context drawImage document getElementById wmark lt Render text gt context textAlign center context textBaseline alphabetic context font bold normal normal 48px Times New Roman context fillText FREE Coffee 256 224
154. t Feed cut A oe Drawer Kick Out Supported Buzzer Not supported 219 80mm Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 220 Appendix TM T70 Multi language model 80mm 58mm Interface Ethernet Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 576 dots 416 dots Font Font A Font B For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Line Font A ANK 42 characters ANK 34 characters Font B ANK 56 characters ANK 46 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 17 dots W x H Character Baseline Font A At the 21st dot from the top of the character Font B At the 15th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area 576 dots x 1662 dots W x H 416 dots x 1662 dots W x H Page Mode Maximum Area 576 dots x 1662 dots W x H 416 dots x 1662 dots W x H Raster image Monochrome image Logo Monochrome image Bar Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 Two Dimensional Code PDF417 QR Code Ruled Line Not supported Paper Cut Cut Feed cut Sere T Drawer Kick Out Supported Buzzer No
155. t epos print xmins http www epson pos com schemas 2011 03 epos print gt ke lt text align center gt lt image width 256 height 60 color color_1 mode mono gt AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA x Apply x Information x The import process has been completed Close Errorcerrransmssorrversor panpa elean E A A Data to be import Paste and check the ePOS Print XML print document to be imported ePOS Print XML Apply Imports the ePOS Print XML print document Information Displays the import information Close Closes the Import screen ePOS PrintEditor can import an ePOS Print XML print document as follows A Select the Edit tab and click the Import button 2 The Import screen appears Paste the ePOS Print XML print document in the Data to be import ePOS Print XML box 3 Click the Apply button 4 The Confirmation screen appears Click the Yes button Appendix Appendix Printer specifications TM T88V i 80mm Interface Ethernet Wireless LAN Resolution 180 dpi x 180 dpi W x H Print Width 512 dots Font Font A Font B For more information about what character codes can be printed refer to the user s ma
156. t made public For details contact the dealer Syntax addCommand data Parameter e data Optional parameter Object type String Specifies ESC POS command as a character string Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder var doc builder addCommand ABC x44 x45 x0a PARA lt script gt 132 Chapter 4 ePOS Print API toString method Obtains a print document generated by an ePOS Print Builder object Syntax toString Return value Return value Object type Document to be printed String Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder var doc builder toString gt lt script gt 133 halftone property Halftone processing method in firmware Ver 1 2 and later Object type String Description The halftone processing method to be applied to monochrome two tone printing is specified The default value is HALFTONE_DITHER HALFTONE_DITHER default Dithering s
157. t supported Paper Layout Settings Not supported 221 80mm 58mm Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 222 Appendix TM L90 i Receipt Die cut label Interface Ethernet Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 256 dots 38mm to 224 dots 38mm to 576 dots 80mm 560 dots 80mm Font Font A Font B Font C For more information about what character codes can be printed refer to the user s manual that came with the printer Characters in a Font A ANK 48 characters ANK 46 characters Line Font B ANK 57 characters ANK 56 characters Font C ANK 72 characters ANK 70 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 10 dots x 24 dots W x H Font C ANK 8 dots x 16 dots W x H Character Font A At the 21st dot from the top of the character Baseline Font B At the 21 st dot from the top of the character Font C At the 15 st dot from the top of the character Default Line Feed Space 30 dots Color Specification First color First color Second color when two color printing is set Raster Image Monochrome image Two color image Logo Monochrome image Two color image To perform two color printing change the settings of the printer using the memory switch setting utility Bar Code UPC A UPC E EAN13 JAN13 EAN8 JAN8 C
158. tContext 2d Set the end point address var address http 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Create an ePOS Print Canvas API object var epos new epson CanvasPrint address Set a response receipt callback function epos onreceive function res When the printing is not successful display a message if res success alert A print error occurred Print SS epos cut true epos print canvas Print result receipt callback function lt script gt lt head gt lt body gt lt button onclick drawCanvas gt Run lt button gt lt canvas id myCanvas width 512 height 480 gt lt canvas gt lt img id coffee src img coffee jpg alt gt lt img id wmark src img wmark png alt gt lt body gt lt html gt Chapter 3 Programming Guide Error handling Refer to the following program for the error handling method by a callback function var epos new epson CanvasPrint address Set a response receipt callback function epos onreceive function res Obtain the print result and error code var msg Print res success Success Failure nCode res code nStatus n Obtain the printer status var asb res status if asb amp epos ASB_NO_RESPONSE msg No printer response n if asb amp epos ASB_PRINT_SUCCESS msg Print complete n
159. ters ANK 30 characters ANK 25 characters Line Font B ANK 40 characters ANK 36 characters ANK 30 characters Character Size Font A ANK 4 5 dots x 9 dots W x H Font B ANK 3 5 dots x 9 dots W x H Character Font A Bottom of the characters Baseline Font B Bottom of the characters Default Line Feed Space 12 dots Color Specification First color First color Second color When using a two color ribbon cassette Raster Image Monochrome image Logo Not supported Bar Code Not supported Two Dimensional Code Not supported Ruled Line Not supported Page Mode Default Area Not supported Page Mode Maximum Area Not supported Page Mode Line Not supported Rectangle Paper Cut Cut Feed cut 235 236 Specification of the paper feed 76mm 70mm 58mm position for labels black mark Not supported paper Drawer Kick Out Supported Buzzer Not supported Paper Layout Settings Not supported Forced transmission mode Not supported Recovery from an error Not supported Reset Supported Command Supported Appendix Paper setting function of TM L90 Setting Paper Width It sets the paper width with memory switch setting mode A Turn the printer s power off and set the receipt paper While the cover is opened turn the power on while pressing the FEED button After confirming the ERROR LED lights up press the FEED button twice and close the cover h QON S
160. the printing color in 2 tone The print result is displayed Appendix Rendering Graphics canvas print graph html Draw an image in HTML5 Canvas and perform a test print r aja 1 TSE Ciria O O x 8 eson ePOS Print Sample X iy Le 93 Canvas Graphics Editing Fill Settings Style Linear Gradient Color 1 gray Errggbb Swap Color Color 2 white Errggbb Rectangle Position x 32 y 64 Size w 192 h192 Circle Center Reset URL http 192 168 192 168 cgi bin epos service cgi devid local_printer8timeout 10000 Mode Monochrome Brightness 1 0 Halftone Monochrome Error Diffusion v Alignment Left Color Monochrome Color 1 w V Cut Paper L A Open the following URL page using the Web browser http Web server IP address canvas canvas print graph html 2 EPSON ePOS Print Sample Program appears Set items on the right of the page The following items can be set Desctiption Fill Settings Specify the fill type and color Rectangle Specify the start coordinates width and height Circle Specify the central coordinates and radius Clear Clears the image drawn in the Canvas Reset Clears the image drawn in the Canvas In addition the settings are reset to their default values Click the
161. thod in firmware Ver 1 2 and later Object type String Description The halftone processing method to be applied to monochrome two tone printing is specified The default value is HALFTONE_DITHER HALFTONE_DITHER Dithering suitable for printing graphics only HALFTONE_ERROR_DIFFUSION Error diffusion suitable for printing text and graphics together HALFTONE_THRESHOLD Threshold suitable for printing text only Example To set the halftone type as error diffusion lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementBylId myCanvas var epos new epson CanvasPrint address epos halftone epos HALFTONE_ERROR_DIFFUSION epos print canvas gt lt script gt 176 Chapter 5 ePOS Print Canvas API brightness property Brightness correction value in firmware Ver 1 2 and later Object type Number Description A gamma value in the range 0 1 10 0 is specified for the brightness correction value The default value is 1 0 Example To set brightness as 2 2 lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var c
162. ting such as printing receipts that requires the paper length to change according to the print space Page mode In page mode you set a print area lay out data in it and print the data in a batch operation Characters images and barcodes are laid out in the print positions coordinates 41 42 Programming Flow For the ePOS Print API programming is performed based on the following work flow 1 Embedding of ePOS Print API p 43 2 Print Document Creation p 44 1 To create a text print document p 45 1 To create a graphic print document p 46 1 To create a page mode print document p 47 3 Transmission of Print Document p 48 4 Reception of Print Result p 49 ePOS Print supported TM printer checks the status of the TM printer to be used for printing and then starts printing operation in firmware Ver 1 2 and later A status event helps check the status of the TM printer For details on the procedure refer to Reception of Status Event p 51 in firmware Ver 1 2 and later Chapter 3 Programming Guide Embedding of ePOS Print API The ePOS Print API is provided so that ePOS Print can be used from the Javascript on the client side It is provided as JavaScript and its file name is epos print 3 x x js The ePOS Print API is used by embedding epos print 3 x x js into applications Preparation To use the ePOS Print API place epos print 3 x x js on the Web server Embedding into Web p
163. to 65535 4 width Required parameter Object type Number Specifies the width of the print area Specifies an integer from 0 to 65535 height Required parameter Object type Number Specifies the height of the print area Specifies an integer from 0 to 65535 e color Optional parameter Object type String COLOR_NONE Characters are not printed COLOR_1 default First color COLOR_2 Second color COLOR_3 Third color COLOR_4 Fourth color undefined Specifies the color First color When not specified 87 88 e mode Optional parameter Object type String Specifies the color mode in firmware Ver 1 2 and later MODE_MONO Monochrome two tone MODE_GRAY16 Gray scale 16 tone undefined l Monochrome two tone When not specified Return value Return value ePOS Print Builder Object Object type ePOS Builder Exception Object iype Parameter is invalid Error Example lt script type text javascript lt script type text javascript gt lt function buildMessage var builder new epson ePOSB if canvas getContext var context canvas getCon builder addImage context 0 gt lt script gt var canvas document getElementById canvas src epos print 3 x x js gt lt script gt uilder text 2d 0 canvas width canvas height To print
164. ttern 8 in firmware Ver 2 2 and later PATERN_9 Pattern 9 in firmware Ver 2 2 and later PATERN_10 Pattern 10 in firmware Ver 2 2 and later undefined When not specified rns 123 e repeat Optional parameter Object type String Specifies the number of repeats a VA 0 The buzzer does not stop l to 255 Number of repeats undefined One time When not specified After 0 is specified for repeat if you want to stop the buzzer execute this API function and specify PATTERN_NONE for pattern e cycle Optional parameter Object type String When not specified 1000 Specifies the buzzer sounding cycle in units of milliseconds MER O PS A 1000 to 25500 1000 to 25500 milliseconds undefined 1000 milliseconds NQ PATTERN_A to PATTERN_E PATTERN_ERROR PATTERN_PAPER_END is disregarded Return value Object ype ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error Example To repeat the sound pattern A three times lt script type text javascript gt siss function buildMessage var builder new epson ePOSBuilder builder addSound builder PATTERN_A 3 gt lt script gt lt script type text javascript src epos print 3 x x js gt lt script gt 124 Chapter 4 ePOS Print API addLayout method Adds paper layout information to t
165. ttings of the terminal to match the router settings so as to enable network connection For details refer to the manual for the device you are using 5 Network Setting of ePOS Print Supported TM printer p 35 Configuration is done from a Web browser 6 Network settings for the printer to be controlled Configure these settings by using the network setting utility For details refer to the detailed instruction manual for the printer these settings are not required in this sample program 33 7 Device ID Settings p 37 Configuration is done from a Web browser these settings are not required in this sample program 8 Sample Program Settings p 39 Configuration is done from a Web browser these settings are not required in this sample program Registration of Sample Program ePOS Print_API_UM_E_Sample zip Register the sample program into the Web server Download ePOS Print_API_UM_E_Sample zip NH For details refer to Contents in the package p 21 Register the program according to the following procedure A Start the Web server 2 Explode the sample program ePOS Print_API_UM_E_Sample zip and then copy the exploded contents into the following folder Example Web server configured by using IIS System drive Inetoub wwwroot Q Copy the sample program as a user with administrator authority 34 Chapter 2 Sample Program Network Setting of ePOS Print Supported TM printer A TM i p
166. ttp 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos oncoveropen function alert coveropen de function startMonitor epos open function stopMonitor epos close gt lt script gt 168 Chapter 5 ePOS Print Canvas API recover method Recovers from an error in firmware Ver 3 0 and later Recovers from errors that can be recovered from and clears the buffer Syntax recover Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt Sila var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos oncoveropen function alert coveropen function recover epos recover gt lt script gt reset method Resets the printer in firmware Ver 3 0 and later Syntax reset Example 5 lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos oncoveropen function alert coveropen di function reset epos reset gt lt script gt 169 address property URL of the printer
167. tus of the printer Object type Number Description Battery status obtained from the last printer status This is read only Default value O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onbatterylow function alert epos battery Fa epos open gt lt script gt 174 Chapter 5 ePOS Print Canvas API timeout property Specifies connection timeout Object type Number Description Specifies connection timeout with ePOS Print supported printer in milliseconds When the transmission of print document by print method times out onerror even is generated Default value 300000 5 minutes Example lt script type text javascript lt script type text javascript gt eres var address var canvas http 192 168 document get var epos epos timeout epos onreceive 60000 function re epos onerror function err epos print canvas gt lt script gt Element new epson CanvasPrint address src epos print 3 x x js gt lt script gt 192 168 cgi bin epos service cgi devid local_printer Byld myCanvas s alert res success alert err status 175 halftone property Halftone processing me
168. type text javascript gt te oa function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addPageLine 100 0 500 0 builder LINE_THIN builder addPageEnd gt lt script gt 116 Chapter 4 ePOS Print API addPageRectangle method Adds rectangle drawing in page mode to the command buffer Draws a rectangle in page mode N Syntax Use this API function by inserting it between addPageBegin p 107 and PageEnd p 108 addPageRectangle x1 yl x2 y2 style Parameter e xi Required parameter Object type Number Specifies the horizontal start position of the line in dots Specifies an integer from 0 to 65535 e yl Required parameter Object type Number Specifies the vertical start position of the line in dots Specifies an integer from 0 to 65535 e x2 Required parameter Object type Number Specifies the horizontal end position of the line in dots Specifies an integer from 0 to 65535 e y2 Required parameter Object type Number cSpecifies the vertical end position of the line in dots Specifies an integer from 0 to 65535 e style Optional parameter Object type String Specifies the line type Constant siye LINE_THIN Solid line Thin LINE_MEDIUM Solid line Medium LINE_THICK Solid line Thick LINE_THIN_DOUBLE Double line Thin LINE_MEDIUM_DOUBLE Double line Medium LINE_THICK_DOUBLE Doub
169. uitable for printing graphics only HALFTONE_ERROR_DIFFUSION Error diffusion suitable for printing text and graphics together HALFTONE_THRESHOLD Threshold suitable for printing text only Example To set the halftone type as error diffusion lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder var canvas document getElementById canvas if canvas getContext var context canvas getContext 2d builder halftone epos HALFTONE_ERROR_DIFFUSION builder addImage context 0 0 canvas width canvas height gt lt script gt 134 Chapter 4 ePOS Print API brightness property Brightness correction value in firmware Ver 1 2 and later Object type Number Description A gamma value in the range 0 1 10 0 is specified for the brightness correction value The default value is 1 0 Example To set brightness as 2 2 lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder var canvas document getElementById canvas if canvas getContext var context canvas getContext 2d builder brightness 2 2 builder addImage context 0 0 canvas width canvas height gt lt script gt
170. us alert success y epos print canvas os lt script gt 191 onerror event This property registers the callback function and obtains a communication error event Syntax Function error Parameter of the callback function Parameter error See Properties of the error object on page 192 Name Communication error information Object type Object Properties of the error object propery Nome Object vpe status HTTP status Number responseText Responce text String Example To print Canvas ID myCanvas To display the HTTP status code in a message box when a communication error occurs lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function printCanvas var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var canvas document getElementById myCanvas var epos new epson CanvasPrint address epos onerror function err var status err status var text err responseText alert status Y epos print canvas gt lt script gt 192 Chapter 5 ePOS Print Canvas API onstatuschange event Registers a callback function to obtain a status change event in firmware Ver 1 2 and later Syntax Function status Parameter of the callback function Parameters status Name Status Object type Number Example
171. var epos new epson ePOSPrint address epos ononline function alert online Y epos open gt lt script gt 153 onoffline event Registers a callback function to obtain a offline event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt los var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onoffline function alert offline Y epos open gt lt script gt onpoweroff event Registers a callback function to obtain a non response event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript lt script type text javascript gt lt var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson ePOSPrint address epos onpoweroff function alert poweroff Y epos open gt lt script gt src epos print 3 x x js gt lt script gt 154 Chapter 4 ePOS Print API oncoverok event Registers a callback function to obtain a cover close event in firmware Ver 1 2 and later Object type Function O Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script ty
172. ware Ver 1 2 and later Chapter 5 ePOS Print Canvas API IEC IE IS EI E Constant ASB_ Response document status HALFTONE_ Halftone type MODE _ Color mode ALIGN_ Position alignment COLOR_ Color specification FEED_ Paper feed position of label paper black mark paper PAPER_ Type of papers 163 eP OS Print Canvas API Object Prints a print image rendered in HTML5 Canvas and monitors the print result or the communication status Constructor for an ePOS Print Canvas API object Creates a new ePOS Print Canvas API object and initializes it Syntax CanvasPrint address Parameter e address Optional parameter Object type String Specifies the address property URL of printer to be used for printing The URL is as follows http ePOS Print supported TM printer cgi bin epos service cgi devid device ID of printer to be used for printing amp timeout timeout time Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt lt function printCanvas var address http 192 168 192 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address gt lt script gt 164 Chapter 5 ePOS Print Canvas API print method Prints an image rendered in HTML5 Canvas Converts the specified range in a RGBA full color image of HTML5
173. ware Ver 1 2 and later Forced transmission mode force SN 136 in firmware Ver 3 0 and later message Message buffer 137 Constant FONT_ font ALIGN_ alignment COLOR_ color specification HALFTONE_ Halftone type in firmware Ver 1 2 and later MODE_ Color mode in firmware Ver 1 2 and later BARCODE_ bar code type HRI_ HRI position SYMBOL_ two dimensional code type LEVEL_ error correction level LINE_ line style DIRECTION_ page mode print direction CUT_ paper cut type DRAWER_ drawer kick out connector PULSE_ drawer kick out pulse length Constant PATTERN_ buzzer sound pattern FEED_ Paper feed position of label paper black mark paper LAYOUT_ Type of papers Numerical values to be set to parameters In the ePOS Print Builder object API numerica following in mind A Unit values are set to some parameters Set values with the Specify numbers in dots for units that represent length Print position paper feed space width and height of images and barcodes etc T Range Depending on the printer specifications a specifiable range is predetermined For details refer to Printer specifications p 209 1 Resolution The resolution varies depending on the printer It affects the actual print size The higher the resolution is the smaller the print size becomes and vice versa For each printer s resolution refer to Printer specifica tions p 209 Chapter 4 ePOS Print API window epson ePOSPrint Co

Download Pdf Manuals

image

Related Search

Related Contents

LG HT762PZ User's Manual  User manual - Prolight Concepts  Graco 308655J User's Manual  Manuale dell`utente Creative Sound Blaster Audigy Creative Audio  詳細取扱説明書  LAN Control Utility User Manual Contents  Shark NV581 Use and Care Manual  

Copyright © All rights reserved.
Failed to retrieve file