Home

ePOS-Print SDK for JavaScript User`s Manual

image

Contents

1. ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 addSymbol method p 81 addTextAlign method p 54 addPageBegin method p 92 adaTextLineSpace method p 54 addPageEnd method p 90 adaTextRotate method p 56 addPageArea method p 94 addText method p 57 addPageDirection method p 96 addTextLang method p 58 addPagePosition method p 98 addTextFont method p 60 addPageLine method p 100 adaTextSmooth method p 61 addPageRectangle method p 102 addTextDouble method p 62 addCut method p 104 addTextSize method p 63 addSound method p 107 addTextStyle method p 64 addRecovery method 6 113 adaTextPosition method p 66 addReset method p 114 adaTextVPosition method p 67 addCommand method p 115 addFeedUnit method p 68 toString method p 116 addFeedLine method p 69 halftone property p 17 addFeed method p 72 brightness property p 118 addlmage method p 73 force property p 119 adaLogo method p 75 message property p 120 adaBarcode method p 76 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 12 onstatuschange event p 132 send method p 122 onbatterystatuschange event p 132 open method p 123 ononline event p 139 close method p 124 onoffline event p 133 adaress property p 125 onpoweroff event p 134 enabled property p 125 oncoverok event p 134 interval property p 126 oncoveropen e
2. ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 paper property p 185 print method p 142 layout property ps 186 open method p 144 onreceive event p 161 close method p 144 onerror event p 164 recover method p 145 onstatuschange event p 165 reset method p 145 onbatterystatuschange event p 165 address property p 146 onbatteryok event p 166 enabled property p 146 onbatterylow event p 166 interval property p 147 ononline event p 167 status property p 147 onoffline event p 167 battery property p 148 onpoweroff event p 168 timeout property p 148 oncoverok event p 168 halftone property p 149 oncoveropen event p 169 brightness property p 150 onpaperok event p 169 cut property p 150 onpapernearend event 170 align property p 152 onpaperend event p 170 feed property p 154 222 Appendix TM P80 Receipt 80 mm Interface Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 576 dots 546 dots 42 column mode 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 den ne Res ANK 48 characters Line Font B ANK 64 characters Font A 42 column ANK 42 characters mode Font B 42 column ANK 60 characters mode Character Size Font A ANK 12 dots x 24 dots W x H
3. ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 paper property p 185 print method p 142 layout property ps 186 open method p 144 onreceive event p 161 close method p 144 onerror event p 164 recover method p 145 onstatuschange event p 165 reset method p 145 onbatterystatuschange event p 165 address property p 146 onbatteryok event p 166 enabled property p 146 onbatterylow event p 166 interval property p 147 ononline event p 167 status property p 147 onoffline event p 167 battery property p 148 onpoweroff event p 168 timeout property p 148 oncoverok event p 168 halftone property p 149 oncoveropen event p 169 brightness property p 150 onpaperok event p 169 cut property p 150 onpapernearend event 170 align property p 152 onpaperend event p 170 feed property p 154 214 Appendix TM P60Il Receipt 58 mm Receipt 60 mm 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 h ters i Font A or ES er ANK 35 characters ANK 36 characters Font B ANK 42 characters ANK 43 characters Font C ANK 52 characters ANK 54 characters Character Size Font A ANK 12 dots x
4. 226 Appendix TM U220 76 mm 70 mm 58 mm Interface 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 on ne FCD ANK 33 characters ANK 30 characters ANK 25 characters 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 ee FOM 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 Page Mode Default Area Not supported Page Mode Maximum Area Not supported Raster Image Monochrome image Logo Not supported Barcode Not supported 2D Code Not supported Ruled Line Not supported Page Mode Line Not supported Rectangle Paper Cut Cut Feed cut Specification of the paper feed position for labels black mark Not supported paper Drawer Kick Out Supported Buzzer Not supported 227 76 mm 70 mm 58 mm Paper Layout Settings Not supported Forced transmission mode Not supported Recovery from an error Not supported Reset Supported Command Supported ePOS Prin
5. 140 Element IS Deserion E Event onbatteryok Battery OK event 166 onbatterylow Battery low event 166 ononline Online event 167 onoffline Offline event 167 onpoweroff Non response event 168 oncoverok Cover close event 168 oncoveropen Cover open event 169 onpaperok Paper remaining event 169 onpapernearend Paper near end event 170 onpaperend Paper end event 170 ondrawerclosed Drawer close event 171 ondraweropen Drawer open event 171 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 Chapter 5 Canvas API Reference ePOS 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 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 devidz device ID of printer to be used for printing amp timeoutz timeout time Example lt script type text javascript src epos print 3 x x j
6. Device ID of the target printer Print timeout millisecond Specifies the timeout time default 60000 Print in grayscale Coupon Prints coupons in gray scale Default No Only for supported models Set the paper layout Label Prints labels with specified layout Default No Only for TM P6O0II 31 32 Chapter 3 Programming Guide Programming Guide This chapter describes how to write programs in the application development using ePOS Print e ePOS Print API p 33 e ePOS Print Canvas API p 43 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 printing such as printing receipts that requires the paper length to change according to the print space Page mode 3 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 33 34 Programming Flow For the ePOS Print API programming is performed based on the following work flow 1 Embedding of ePOS Print SDK for JavaScript p 35 2 Print Document Creation p 36 LJ To create a text print document p 37 1 To create a graphic print document p 37 LJ To cr
7. ITF Start and stop codes are automatically added Check digits are not added or validated 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 Chapter 4 API Reference Barcode type CODE93 Start and stop characters are automatically added A check digit is automatically calculated and added CODE128 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 lt How to specify special characters gt lt How to specify CODE C gt GS1 128 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 AI in parentheses The parentheses are used as HRI print characters and are not encoded as data You can insert spaces between an application identifier 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 How to specify special characters o lt H
8. function buildMessage var builder new epson ePOSBuilder builder addLayout builder LAYOUT RECEIPT BM 580 0 15 0 lt script gt To set 58 mm 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 script To set 58 mm die cut label with black mark 112 lt script type text javascript src epos print 3 x x js script 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 15 gt lt script gt Chapter 4 API Reference addRecovery method Adds the recovery from errors to the command buffer Enable forced transmission 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 type 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 script script type text javascript
9. if asb amp epos ASB PRINT SUCCESS msg Print completeln ae if asb epos ASB DRAWER KICK msg Status of the drawer kick number 3 connector pin H n if asb amp epos ASB OFF LINE msg Offline status n if asb amp epos ASB_COVER_OPEN msg Cover is open n if asb amp epos ASB_PAPER_FEED msg Paper feed switch is feeding paper n if asb amp epos ASB_WAIT_ON_LINE msg Waiting for online recovery n if asb amp epos ASB_PANEL_SWITCH msg Panel switch is ON n if asb amp epos ASB_MECHANICAL_ERR msg Mechanical error generated n if asb amp epos ASB_AUTOCUTTER_ERR msg Auto cutter error generated n if asb amp epos ASB_UNRECOVER_ERR msg Unrecoverable error generated n if asb amp epos ASB_AUTORECOVER_ERR msg Auto recovery error generated n if asb amp 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 detector n if asb amp epos ASB_BUZZER msg Sounding the buzzer limited model Nn if asb amp epos ASB_SPOOLER_IS_STOPPED msg Stop the spooler n Display in the dialog box alert msg 47 Reception of Status Event The status event notificati
10. a Use forced transmission mode when the printer is offline It will result in an error if the printer is Example Performs a drawer kick out when the paper is at the end script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder force true builder addPulse lt script gt 119 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 script type text javascript src epos print 3 x x js script script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder builder addText ABCDE builder message gt lt script gt 120 Chapter 4 API Reference ePOS Print Object 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 address Optional parameter Object type String Specifies
11. Parameter e dw Optional parameter Object type Boolean Specifies the double sized width FE TD GE I ARM true or 1 Specifies the double sized width false or O default Cancels the double sized width undefined f Retains the current setting for double sized width When not specified Optional parameter Object type Boolean Specifies the double sized height true or 1 Specifies the double sized height false or 0 default Cancels the double sized height undefined f i 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 S printed Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error Example To set the size as double width and height amp L lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt function buildMessage var builder new epson ePOSBuilder builder addTextDouble true true lt script gt Chapter 4 API Reference addTextSize method Adds the text scale setting to the command buffer Syntax addTextSize width height Parameter e width Optional parameter Object type Number Specifi
12. message propelly sake 120 ePOS Print Object PPP 121 O mM T 121 send Method ss p M 122 open meENOd ka E HTTP 123 Close o MER E 124 olo lo KESA prope ty ess on dr d e d RR OR NR eaa CORN MR RR p ERREUR Y E DANT RR DRAN UP FOREN RUNE 125 enabled properly tetro eere ien e tr e iis aar cr E E Y ERE Y FCR E P da 125 ISA hl ole oE PTT a MER 126 status property ni ELE 126 IDatterviDIOP ert sado Dessert dolido Ca o OR Eur eo 127 Tire ouUtproertyuiueci e tree a reete va er o ce Ed c e ta re ter ine 127 ela ELEN ETEN Ea 128 oneroreveht LEE 131 onstatusehange SVEN kutrur A A A 132 onbatterystatuschange even uice eere A PP e ng 132 ONONIIMS SVEN MER MEE 133 nofflihe event LEE 133 ola er ET OLENE 8 Ee 134 oneoverok VO iii rta rarer EE dansa Ed A di di 134 oncoveropen EN EO 135 onpap rok event rase RE e i e E Up TA Aakre daa IN GTA LAGA 135 onpapernearend event EE eene nennen nennen nennen nnns 136 onpaperend event cesa repa eim on HW PX ER da LEV CIV EYE X TE Ye V P RR 136 ondrawerclosed even ira Di eer a n ne epa a FC v n CR RA Ren a ra nn Dea xa A ERA 137 orndraweropen verba e etc Gulla tyre hr de ba ticas rue Eee best P e Ue Ws 137 ONpater Ok Sven kuns harde ctae dips exter ned pe ber dede uc ip btt a S Bre ii T 138 onbatterylOw EVENT aset dera ice ea ect fefe qa c Ce ed ee con d de Y Cp e eO il RC 138 Canvas API Reference Vava eine 139 E List of ePOS Print Canvas API functions snerrrrrrnnnv
13. 20 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 CEEEAEEEA TAE 1 Open the sample program Web page RR HMM ORCC E RE Oe OE CECE OE OCTET OCCT CE OTT 2 Settings 4 Settings of IP address of TM printer 4 Device ID of the TM printer Print timeout time EE ee as NCL Ee AE 3 Click Queue Ticket 4 Creates print data ePOS Print Builder Object 5 Prints ePOS Print Object Action on the sample program p AAA Action on the customer VOD Chapter 2 Sample Program Coupon issuance ePOS Print Canvas API EEE 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 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 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 E E E E E E E E E E E E E E E E E 2 Settings J Settings of IP address of TM printer AQ Device ID of the TM printer A Print timeout time AAA AAA AAA 4 Settings of multiple tone printing EEE A D HENDENE 3 Click Coupon KKKKTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT TN at 4 Render in HTML5 Canvas 5 Prints ePOS Print Canvas API Object 1 Action on the sample program Action on the customer TS 21 22 Label issuance ePOS Print API p dd arr arr ror ror ar r r ar ar roa ar r r ar ar ar ar ar r r ror roa
14. 229 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 color property p 153 print method p 142 onreceive event p 161 open method p 144 onerror event p 164 close method p 144 onstatuschange event p 165 reset method p 145 ononline event p 167 adaress property p 146 onoffline event p 167 enabled property p 146 onpoweroff event p 168 interval property p 147 oncoverok event p 168 status property p 147 oncoveropen event p 169 timeout property p 148 onpaperok event p 169 halftone property p 149 onpapernearend event p 170 brightness property p 150 onpaperend event 6 170 cut property p 150 ondrawerclosed event be 121 align property p 152 ondraweropen event Ex 171 230 Appendix Paper setting function of TM L90 Setting Paper Width It sets the paper width with memory switch setting mode 4 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 QN Select 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
15. 132 Chapter 4 API Reference ononline event Registers a callback function to obtain a online event Object type Function Example lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 var address http 192 168 192 168 cgi bin epos service cgi devid local printer var epos new epson ePOSPrint address epos ononline function alert online Y epos open gt lt script gt onoffline event Registers a callback function to obtain a offline event 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 sles 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 133 onpoweroff event Registers a callback function to obtain a non response event Object type Function 0 Example lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 oncoverok even
16. Adds 2D code printing to the command buffer In page mode a 2D code is laid out in the current print position with the reference point being its YH bottom left dot Syntax addSymbol data type level width height size Parameter data Required parameter Object type String Specifies 2D code 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 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 0109 QR Code Model 2 Alphanumeric character 0to 9 AtoZ space n Kanji character Shift JIS value 8 bit byte data Ox00 to Oxff 81 82 2D Code type MaxiCode Mode 2 Convert the character string to the string in UTF MaxiCode Mode 3 8 apply the escape sequence and then MaxiCode Mode 4 encode the string MaxiCode Mode 5 In Modes 2 and 3 when the first piece of data is 0 gt 1 x1e011x1dyy where yy is a two digit num ber 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
17. IP address of TM printer cgi bin epos service cgi devidz 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 UA 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 234 Appendix Rendering Images canvas print image html Draw an image in HTML5 Canvas and perform a test print r e ie 1 FO Diiia D OX amp esow eros erint ample Ld iit ve 9 Canvas Image Editing Sample Shop 2 Matsumoto Nagano Position ty gt x 100 y0 NES K s On ize A Ye w200 h70 KA 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 x Print Alignment Let x Color Monochrome Color 1 w Cut Paper k A Open the following URL page using the We
18. lt var address http 192 168 192 168 cgi bin epos service cgi devid local printer var canvas document getElementByld myCanvas var epos new epson CanvasPrint address epos align epos ALIGN CENTER epos print canvas gt lt script gt 152 Chapter 5 Canvas API Reference 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 4th color Example Prints with the 2nd color 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 153 feed property It sets paper feed of label paper black mark paper 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 p
19. lt script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder builder addPulse builder DRAWER 1 builder PULSE 100 H script 106 Chapter 4 API Reference addSound method Adds the turning on of the buzzer to the command buffer Sets the buzzer Not available in page mode N The buzzer function and the drawer cannot be used together 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 PATERN 2 Pattern 2 PATERN 3 Pattern 3 PATERN 4 Pattern 4 PATERN 5 Pattern 5 PATERN 6 Pattern 6 PATERN 7 Pattern 7 PATERN 8 Pattern 8 PATERN 9 Pattern 9 PATERN 10 Pattern 10 undefined When not specified POE repeat Optional parameter Object type String Specifies the number of repeats ENNIO TE EA gt gt 0 The buzzer does not stop 1 to 255 Number of repeats undefined E P One time When not specified After 0 is specified for repeat if you want to stop the buzzer ex
20. 219 Receipt 58 mm Receipt 60 mm Die cut label 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 Pattern 1 Pattern 10 Stop Paper Layout Settings Supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported Paper Layout Receipt paper Receipt paper a seld Paper type without black with black Fe et men mum mark mark mark mark width sf 290 to 600 290 to 600 290 to 600 290 to 600 height sa 0 0 284 to 1550 0 284 to 1550 0 284 to 1550 margin_top sb 0 130 to 1500 O to 1500 15 to 1500 margin bottom se 0 0 15to0 15to 15 offset_cut sc 0 256 to 50 O to 50 O to 50 offset_label sd 0 0 0 Oto 15 220 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 addSymbol method p 81 addTextAlign method p 54 addPageBegin method p 92 adaTextLineSpace method p 54 addPageEnd method p 90 adaTextRotate method p 56 addPageArea method p v4 addText method p 57 addPageDirection method p 96 addTextLang method p 58 addPagePosition me
21. DNS Security d Security Levet WPA PSK AES Detailed ie Security Level ea par WPA Settines qe Access Control PSK Pre shared Key Port Control er E Authentication Reenter PSK Pre shared Key Certificate E Administrator Settings Administrator Infor 7 zu m D mi Ke Click Transmit The settings are reflected in the TM printer and the screen returns to EpsonNet Config Chapter 2 Sample Program 7 Double click the TM printer 8 Click TCP IP Basic and set the IP address of the TM printer E Network Interface a Method for Specifying IP Address amp Information Basic Administration I Wishes IP Address Setting E Network Basic Wireless Detailed Wirele Subnet Mask 255 amp TCP IP El Default Gateway 192 168 192 1 Basic DNS Bonjour B SNMP Basic E Access Control Port Control 6 Authentication Certificate E Administrator Settings _ Administrator Infor 7 gt Automatic Manual Set usine Automatic Private IP Addressing APIPA IP Address 192 S 168 11 2 255 255 0 Cem ee oe Click Transmit The settings are reflected in the TM printer and the screen returns to EpsonNet Config A Q Disconnect the USB cable turn off the TM printer and then turn it back on This brings the TM printer network settings to an end You can now connect the TM printer to the network 27 TM printer ePOS Print settings Configure the T
22. Font A FONT_B Font B FONT_C Font C FONT_D Font D FONT_E Font E Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object type 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 text javascript gt 1 function buildMessage var builder new epson ePOSBuilder builder addTextFont builder FONT B H gt lt script gt Chapter 4 API Reference addTextSmooth method Adds the smoothing setting to the command buffer Syntax addText Smooth smooth Parameter e smooth Required parameter Object type Boolean Specifies whether to enable smoothing Eo SOHN O Z true or 1 Specifies smoothing false or 0 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 script script type text javascript gt le function buildMessage var builder new epson ePOSBuilder builder addTextSmooth true script 61 62 addTextDouble method Adds the double sized text setting to the command buffer Syntax addTextDouble dw dh
23. Parameter is invalid Error Example To print barcodes 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 EAN13 builder addBarcode 201234567890 builder BAROCDE JAN13 builder addBarcode 2012345 builder BAROCDE EANS8 builder addBarcode 2012345 builder BAROCDE JANS 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 AABCDE builder BARCODE CODE128 builder addBarcode Babcde builder BARCODE CODE128 builder addBarcode CWNx0cNx22 builder BARCODE CODE128 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 lt script type text javascript src epos print 3 x x js gt lt script gt builder addBarcode 01 201234567890 builder BAROCDE GS1 128 Chapter 4 API Reference addSymbol method
24. Printing functions of ePOS Print API a al a a a a a L COCO OOO Print setting alignment line feed space text rotation page mode Character data setting language font device font double sizing scale 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 p 179 2D code printing For 2D codes that can be printed by each model refer to Printer specifications p 179 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 Chapter 1 Overview Print Example Sample Shap Printing a raster image 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 0 000 H ning atar 1 Printing functions of ePOS Print Canvas API 4 Printing of images raster images rendered in HTML5 Canvas A Control of label paper black mark paper 4 Feed cut 4 Response document acquisition print result printer status sys
25. Specifies bottom margin in units of 0 1 mm Paper type Vald volue ronge Receipt 0 Setup not necessary without black mark Receipt with black mark 0 Beso 15 to 0 Distance from the bottom of label paper feed direction is a without black mark positive number 15 to 15 Distance from the top of black mark paper feed direction is a positive number Die cut label with black mark e Value of offset_cut Object type Number When not specified 0 Specifies cut position in units of 0 1 mm 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 Vald volue ronge 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 Distance from the bottom of without black mark label to the cutting position Die cut label Oto 50 Distance from the top of black with black mark mark to the cutting position e Value of offset_label Object type Number When not specified 0 Specifies label bottom position sd per 0 1 mm unit Paper Ne Vald 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 Oto15 Distance from the top of black with blac
26. The interval of upgrading the status is specified in milliseconds 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 script script type text javascript gt xd var epos new epson ePOSPrint address epos interval 1000 epos oncoveropen function alert coveropen epos open gt lt script gt var address http 192 168 192 168 cgi bin epos service cgi devid local printer status property Hold the TM printer s status Object type Number Description This is the status last obtained from the printer This is read only Default value 0 Example script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 var epos new epson ePOSPrint address epos onoffline function alert epos status jos epos open gt lt script gt var address http 192 168 192 168 cgi bin epos service cgi devid local printer 126 Chapter 4 API Reference battery property Hold the TM printer s battery status Object type Number Description Battery status obtained from the last printer status This is read only Default value 0 Example lt script type text javascript src epos print 3 x x js gt lt script gt lt s
27. addTextAlign method Adas the text alignment setting to the command buffer Q This API setting is applied to raster image NV logo barcode 2D code When using the standard mode specify addTextAlign in Position at the beginning of lines In the page mode addTextAlign method specification cannot be used In the page mode use the addTextPosition method to designate the horizontal print position A When the page mode is selected for the print mode to set text rotation use the addPageDirection method p 96 instead of this API function Syntax addTextAlign align Parameter align Return value Required parameter Object type String Specifies the text alignment Constantaigr ALIGN_LEFT default Alignment to the left ALIGN_CENTER Alignment to the center ALIGN_RIGHT Alignment to the right 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 script Chapter 4 API Reference addTextLineSpace method Adds the line feed space setting to the command buffer Syntax a
28. ePOS Print Object Page ePOS Print Object Page onreceive event p 128 ondrawerclosed event pk 137 onerror event p 131 ondraweropen event p 137 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 align property p 152 print method p 142 onreceive event p 161 open method p 144 onerror event p 164 close method p 144 onstatuschange event p 165 recover method p 145 ononline event p 167 reset method p 145 onoffline event 6 167 address property p 146 onpoweroff event p 168 enabled property p 146 oncoverok event p 168 interval property p 147 oncoveropen event p 169 status property p 147 onpaperok event p 169 timeout property p 148 onpapernearend event p 170 halftone property p 149 onpaperend event p 170 brightness property p 150 ondrawerclosed event 171 cut property p 150 ondraweropen event I mode property p 151 190 Appendix TM T70Il Multi language model 58 mm 80 mm Interface Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 416 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 Line Font A ANK 34 characters ANK 48 characters Font B ANK 52 characters ANK 72 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 do
29. epos onreceive function res alert res success epos onerror function err alert err status epos send request 122 Chapter 4 API Reference open method Enables status event operation 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 script type text javascript src epos print 3 x x js script lt script type text javascript gt 1 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 Fi function startMonitor epos open function stopMonitor epos close gt lt script gt 123 lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 function startMonitor function stopMonitor gt lt script gt close method Disables status event operation Syntax close Example 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 ye epos open epos close 124 Chapter 4 API Reference address property URL of the printer Object type String
30. epos print 3 x x js gt lt script gt script type text javascript gt 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 request script 130 Chapter 4 API Reference 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 131 Name Communication error information Object type Object Properties of the error object Property Name 1 Opjeciiype 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 script script type text javascript gt 1 function printHellowWorld var builder new epson ePOSBuilder builder addText Hello World n builder addCut var request builder toString var address http
31. gt 1 function buildMessage var builder new epson ePOSBuilder builder force true builder addRecovery script 113 addReset method Adds the printer reset to the command buffer 2 Other printing commands in the print document are ignored Syntax addReset 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 1 function buildMessage var builder new epson ePOSBuilder builder addReset H script 114 Chapter 4 API Reference addCommand method Adds commands to the command buffer Sends ESC POS commands For information about ESC POS commands see the ESC POS Command Reference Q You can view the ESC POS Command Reference from https reference epson biz com Smax mmNM JM r vv addCommand data Parameter data Optional parameter Object type String Specifies ESC POS command as a character string 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
32. lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 event Registers a callback function to obtain a paper end event Object type Function O Example lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 E epos open gt lt script gt 170 Chapter 5 Canvas API Reference ondrawerclosed event Registers a callback function to obtain a drawer close event 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 var epos new epson CanvasPrint address epos ondrawerclosed function alert drawerclosed 3 epos open gt lt script gt ondraweropen event Registers a callback function to obtain a drawer open event Object type
33. offset cut 25 Feeds to the top of the label epos feed epos FEED NEXT TOF Transmit the print data epos print canvas Receipt paper settings When changing the print paper from label and black mark paper to receipt paper it is necessary to configure the sheet layout See the following for details and sample sources API Page ePOS Print API addLayout method p 109 paper property p 155 ePOS Print Canvas API layout property p 156 232 Appendix Rendering in HTMLS 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 e Rendering Text canvos print text himl p 233 e Rendering Images canvas print image html p 235 e Rendering Graphics canvas print graph html p 237 e Rendering Handwritten Images canvas print hand html p 239 e Rendering Barcode canvas print barcode html p 241 e Rendering Barcode canvas print barcode html p 241 The Web pages introduced here are embedded into the sample program For the details about Q how to place them refer to Environment Settings p 24 Rendering Text canvas print text html Print text in HTML5 Canvas and perform a test print E leales 1 Hey ve E Dimana O OX amp EPSON ePOS Print Sample X i ve 93 Canvas Text Editing
34. status property p 126 onpapernearend event p 136 timeout property p 127 onpaperend event p 136 205 ePOS Print Object Page ePOS Print Object Page onreceive event p 128 ondrawerclosed event pk 137 onerror event p 131 ondraweropen event p 137 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 color property p 153 print method p 142 onreceive event p 161 open method p 144 onerror event p 164 close method p 144 onstatuschange event p 165 recover method p 145 ononline event p 167 reset method p 145 onoffline event 6 167 address property p 146 onpoweroff event p 168 enabled property p 146 oncoverok event p 168 interval property p 147 oncoveropen event p 169 status property p 147 onpaperok event p 169 timeout property p 148 onpapernearend event p 170 halftone property p 149 onpaperend event p 170 brightness property p 150 ondrawerclosed event 171 cut property p 150 ondraweropen event E 1451 align property p 152 206 Appendix TM L90 Receipt Die cut label Interface Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 256 dots 38 mm to 224 dots 38 mm to 576 dots 80 mm 560 dots 80 mm Font Font A Font B Font C For more information about what character codes can be printed refer to the user s manu
35. style Parameter e xl 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 Specifies 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 Gy 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 l Solid line Thin When not specified Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object pe Parameter is invalid Error Chapter 4 API Reference 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 script script type text javascript gt lt function buildMessage var builder new epson ePOSBuil
36. 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 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 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 a For the details about the printer end point address refer to Printer End Point Address p 39 45 Reception of Print Result The print result can be received by setting a callback function using the onreceive property p 128 of the ePOS Print Canvas API object The following information is obtained A Print result 4 Error code 3 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 41 lt DOCTYPE html lt html gt lt head gt lt meta charset utf 8 gt lt title gt TITLE lt title gt script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt function drawCanvas Rendering in HTML5 Canvas Obtain the con
37. 15 DOWNIGOG hes item A stie bet dett 15 ME ee omic 16 sample Program ir eed MERCI oases 17 E Sample Program System Overview eeeeseeeeeeeeeeseee eene nnne nnne 17 samiple Pregtrarti Screens samedi eoe ee 17 Print IMAGE PER 19 POMAR 20 E Operating Environment rrnnnnvnnnnnnvvnnnvnnnnnnnnvnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 23 B Environment Sellings 1 ioter ase 24 Registration of Sample Program ePOS Print Sample JS V3 x xE zip ssseeese 25 Network Setting of TM printer tre rh eee Cr d p Cn a e ren es 26 TM printer SPOSPInIsetingsaa danmark a auti Tom 28 Sample Program Settings x i ener rh den e d e dn E e eO PC ER PO REO ED DR P e IN 30 Programming Guide eese eene 33 ePOS Pint API sd CE 33 Print Mode c HEBES 33 Programming FlOW ua Ar AA 34 Embedding of ePOS Print SDK for JavaScript iincicincinonnoconocionicnccno ro rorono nemen nnnnns 35 Print DOCUMENT Crealbha e TER tits 36 Transmission of Print DOCUMENT adi oii aan b rad ddr 39 Reception of Print RESUIT vies worn d er e E een e eer ie dene aei ee ve e er D e 40 REGEDTION OF Stratus EVEN au sara tt et add dd te s 42 Bl ePOS Print Canvas APl arurnrannunnnnnnnnunnnnnnnnunnnnnnnnnnnnnnnnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnunnnnnnnnunnen 43 Embedding of ePOS Print Canvas API inniicicinicninonccononanono nora no nor rr ran rro rr 43 Rendering in HTML CO
38. 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 lt script gt 131 onstatuschange event Registers a callback function to obtain a status change event Syntax Function status Parameter of the callback function Parameters status Name Status Object type Number Example lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 onbatterystatuschange event Registers call back function and obtains battery status change event Object type Function battery Parameter of the callback function Parameters battery Name Batterystatus Object type Number Example script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 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
39. CODABAR CODE93 CODE128 GS1 128 GS1 DataBar Omnidirectional 6S1 DataBar Truncated 6S1 DataBar Limited GS1 DataBar Expanded 2D Code PDF417 AR Code MaxiCode 6S1 DataBar Stacked GS1 DataBar Stacked Omnidirectional GS1 DataBar Expanded Stacked Composite Symbology not supported Ruled Line Not supported Page Mode Line Not supported Rectangle 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 ePOS Print Setting Item Printing Method Value Thermal 180 dpi Character Code Tables Page 0 5 16 19 20 21 26 30 31 11 15 32 53 180 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 adaBarcode method p 76 adaTextAlign method p 54 addSymbol method p 81 adaTextLineSpace method p 54 adaPageBegin method p 92 adaTextRotate method p 56 addPageEnd method p 90 addText method p 57 addPageArea method p 94 addTextLang method p 58 adaPagebDirection method p 96 addTextFont method p 60 addPagePosition metho
40. 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 amp timeoutz timeout time The default value is the address specified by the constructor Example script type text javascript src epos print 3 x x js script 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 script enabled property Retains the enabled disabled setting for status event operation 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 script script type text javascript gt 1 var address http 192 168 192 168 cgi bin epos service cgi devid local printer var epos new epson ePOSPrint epos oncoveropen function epos open alert epos enabled gt lt script gt address alert coveropen 125 interval property Specifies the interval of upgrading the status Object type Number Description
41. Function Q Example script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt 1 var address http 192 168 192 168 cgi bin epos service cgi devid local printer var epos new epson CanvasPrint address epos ondraweropen function alert draweropen Y epos open gt lt script gt 171 172 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 49 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 iPad Safari in iOS 5 1 or later Displaying ePOS Print Editor f opening a page with ePOS Print Editor s HTML file placed on the local disk some N functionality does not operate due to your Web browser s security policy Place the HTML file of ePOS Editor to a folder under Web server n Google Chrome when a preview image including pictures is displayed a SECURITY ERR DOM Exception 18 error occurs n Windows Internet Explorer 9 when printing is performed a SCRIPT5 Access is denied error occurs Open the following URL page using the Web browser http Web
42. Number Specifies the start position 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 Constant siyle 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 Exception Object type Parameter is invalid Error Chapter 4 API Reference 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 script type text javascript script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder builder addHLine 100 200 builder LINE THIN DOUBLE builder addHLine 400 500 builder LINE THIN DOUBLE src epos print 3 x x js gt lt script gt script 87 88 addVLineBegin method Adds the beginning of vertical line to the command buffer Starts to draw vertical lines Not availa
43. 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 1 mm 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 1 mm Paper Ye Vald volue ronge 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 Dist f th tt f Das istance from the bottom o black mark to the bottom of next with black mark black mark e Value of margin_top Object type Number When not specified 0 Specifies top margin in units of 0 1 mm Paper type Valid value range Receipt 0 Setup not necessary without black mark Esa nerd 150 to 1500 Distance from the top of black mark Die cut label Oto 1500 Distance from the top of label without black mark Die cut label 15 to 1500 Distance from the bottom of with black mark black mark 156 Chapter 5 Canvas API Reference e Value of margin bottom Object type Number When not specified 0
44. RO4 Technical Reference Guide A Technical Reference Guide for each TM printer SampleProgram ePOS Print Sample JS V3 x xE zip The following are included 4 sample index html Sampleprogram 4 editor index html ePOS Print Editor 4 Readme file 4 Rendering in HTML5 Canvas e canvas canvas print text html Rendering text e canvas canvas print image html Rendering images e canvas canvas print graph html Rendering graphics e canvas canvas print hand html Rendering handwritten images e canvas canvas print barcode html Rendering barcode e canvas canvas print label html Rendering label For customers in North America go to the following web site http www epsonexpert com and follow the on screen instructions For customers in other countries go to the following web site https download epson biz com service pos Restrictions 16 Q Printing cannot be done from the TM printer USB interface Please print using the wireless LAN interface Q The drawer and the buzzer cannot be used together 1 The buzzer function cannot be used if the printer is not provided with the buzzer A Internet Explorer and Firefox does not allow printing to the printer to be performed from security pro tected 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 Q The scan
45. Receipt 0 without black mark Setup not necessary Receipt with black mark 0 Distance from the bottom of 15to 0 label paper feed direction is a positive number Die cut label without black mark Distance from the top of Die cut label 1510 15 black mark paper feed with black mark direction is a positive num ber e offset cut Optional parameter Object type Number When not specified 0 Specifies cut position in units of 0 1 mm In case of die cut label paper itis a distance from the bottom of label When a paper has black mark itis a distance from the beginning of black mark Paper Type Valid value range Receipt Aiou black maro 0 Setup not necessary Distance from the top of Receipt with black mark 290 to 50 black mark to the cutting position Die cut label 0 0 50 Distance from the bottom of without black mark label to the cutting position PO O to 50 n iui is non with black mark TE position e offset label Optional parameter Object type Number When not specified 0 Specifies label bottom position sd per 0 1 mm 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 Distance from the top of pU HE Oto 15 due mark to the bottom of Valid value of range is depending on the printer model For detail refer
46. The Confirmation screen appears Click the Yes button 178 Appendix Appendix Printer specifications Model Page Model Page Model Page TM T88V p 179 TM T70 p 195 TM P20 p 211 TM T88IV p 183 es mode P 199 TM P6OII p 215 TM T7OII p 191 TM T90 p 203 TM P OII with Peeler p 219 r moden P 191 TM L90 p 207 TM P80 p 223 TM U220 p 227 58 mm 80 mm Interface Wireless LAN Resolution 180 dpi x 180 dpi W x H Print Width 360 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 Line Font A ANK 30 characters ANK 42 characters Font B ANK 40 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 Baseline Font A At the 21st dot from the top of the character Font B At the l th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area 360 dots x 831 dots W x H 512 dots x 831 dots W x H Page Mode Maximum Area 360 dots x 1662 dots W x H 512 dots x 1662 dots W x H Raster image Monochrome image Gray scale image Logo Monochrome image Gray scale image 179 58 mm 80 mm Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE339 ITF
47. a vertical line e 90 addPageBegin Adds a tag for switching to page mode e 92 addPageEnd Adds a tag for finishing page mode e 93 Pagemode addPageArea Adds a tag for specifying the print area in Tol T page mode addPageDirection Adds a tag for specifying the print direc la ee tion in page mode cere piss a tag for specifying the print position le 68 in page mode Page addPageline Adds a tag for drawing a line in page le 100 mode mode addPageRectan Addsa tag for drawing a rectangle in le 10 gle page mode Cut addCut Adds a tag for paper cut 104 D scar addPulse Adds a tag for the drawer kick out e 105 kick out Buzzer addSound Adds a tag for turning on the buzzer 107 Levit Gee Adds the paper layout setup to command e 109 buffer Recovery addRecovery Adds a tag for recovering from an error e 113 Reset addReset Adds a tag for resetting the printer e 114 Send Adds commands to the command buffer Command Siete one Sends ESC POS commands adi m Create A a Print toString Obtains a print document generated by e 1116 Document on ePOS Print Builder object Chapter 4 API Reference Property halftone Raster image halftone processing method 117 brightness Raster image brightness correction value 118 force Forced transmission mode 119 message Message buffer 120 Constant FONT font ALIGN alignment
48. and click the Print button URL Enter the following URL http IP address of 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 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 htmli Draw a label in HTML5 Canvas and perform a test print E elaks 1 AS 8 Pr EX e ePOS Print Sample Prog imi ry 2 ES Canvas Label Editing Name Name 2 Description Description Name Code 1 i 201234567890 Description Price 19 80 201254567890 3 Reset Test Print URL hittp 192 168 192 168 cgi bin epos service cgi devid local_printer amp timeout 10000 Mode Monochrome ea Brightness 1 0 Halftone Monochrome Threshold v 4 MN oro Alignment Left x Color Monochrome Color 1 x pers Paper Die Cut Label Paper v Feed to Peeling Cut Paper Set the paper layout only for TM P60II TM P80 Layout width 580
49. context textAlign center context textBaseline alphabetic context font bold normal normal 48px Times New Roman serif context fillText FREE Coffee 256 224 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 39 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 script script type text javascript gt function drawCanvas Rendering in HTML5 Canvas Obtain the context var canvas document getElementById myCanvas var context canvas getContext 2d Transmission of print document Set the end point address
50. 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 script tags lt DOCTYPE html lt html gt sr 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 43 44 Rendering in HTML5 Canvas Render an image in HTML5 Canvas lt DOCTYPE html gt lt html gt lt head gt Rendering in HTML5 Canvas lt meta charset utf 8 gt lt title gt TITLE lt title gt 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 lt Render an image gt context clearRect 0 0 512 480 context drawImage document getElementById coffee 0 O 512 384 context fillStyle rgba 255 255 255 0 5 context fillRect 0 0 512 480 context fillStyle rgba 0 0 0 1 0 Render a water mark for the image context drawImage document getElementById wmark 0 0 context drawImage document getElementById wmark 256 324 lt Render text gt
51. halftone property 6117 addFeed method p 72 brightness property p 118 addlmage method p 73 force property p 119 adaLogo method p 75 message property p 120 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 121 onstatuschange event p 132 send method p 122 ononline event p 139 open method p 123 onoffline event p 139 close method p 124 onpoweroff event p 134 adaress property p 125 oncoverok event p 134 enabled property p 125 oncoveropen event p 135 interval property p 126 onpaperok event p 135 status property p 126 onpapernearend event p 136 209 ePOS Print Object Page ePOS Print Object Page timeout property p 127 onpaperend event 6 136 onreceive event p 128 ondrawerclosed event p 137 onerror event p 181 ondraweropen event p 137 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 feed property p 154 print method p 142 paper property p 155 open method p 144 layout property p 156 close method p 144 onreceive event p 161 recover method p 145 onerror event p 164 reset method p 145 onstatuschange event p 165 address property p 146 ononline event p 167 enabled property p 146 onoffline event p 167 interval property p 147 onpoweroff event p 168 status property p 147 oncoverok event p 168 timeout propert
52. 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 amp timeoutz 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 script script type text javascript gt 1 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 enabled property Retains the enabled disabled setting for status event operation 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 script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 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 enabled gt lt script gt 146 Chapter 5 Canvas API Reference interval property Specifies the interval of upgrading the status Object type Number Description The interval of upgrading the status is spec
53. page mode 2 Use this API function with addVLineBegin p 88 Syntax addVLineEnd x style Parameter ex Required parameter Object type Number Specifies the end position of the vertical line in dots Specifies an integer from 0 to 65535 style Optional parameter Object type String Specifies the type of the line you want to finish drawing Constant Gy 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 vpe Parameter is invalid Error Chapter 4 API Reference 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 script 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 script 91 92 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 t
54. property p 126 onpapernearend event p 136 timeout property p 127 onpaperend event p 136 193 ePOS Print Object Page ePOS Print Object Page onreceive event p 128 ondrawerclosed event pk 137 onerror event p 131 ondraweropen event p 137 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 align property p 152 print method p 142 onreceive event p 161 open method p 144 onerror event p 164 close method p 144 onstatuschange event p 165 recover method p 145 ononline event p 167 reset method p 145 onoffline event 6 167 address property p 146 onpoweroff event p 168 enabled property p 146 oncoverok event p 168 interval property p 147 oncoveropen event p 169 status property p 147 onpaperok event p 169 timeout property p 148 onpapernearend event p 170 halftone property p 149 onpaperend event p 170 brightness property p 150 ondrawerclosed event 171 cut property p 150 ondraweropen event I mode property p 151 194 Appendix TM T70 80 mm Interface 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
55. quality of barcodes 2D codes printed as multiple tone raster images cannot be guaranteed Print them as two tone images 1 If printing was cancelled perform the following settings to clear the data left in the printer 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 TM P80 Chapter 2 Sample Program sample Program This chapter describes how to use the sample program In this chapter descriptions are made based on a system configuration using a Web server Q 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 C e am mu p gt 6 x amp epos print ePOS Print Demo 1 Queue Ticket 2 Coupon 3 Label 4 Settings AE AO PSA A SA Prints queue ticket numbers 1 Queue Ticket na This is a sample program using the ePOS Print API Prints coupons 2 Coupon This is a sample program using the ePOS Print Canvas API Prints labels 3 Label This is a sample program usin
56. r Hello World NUT 2 Hello World x0 y24 Hello World Tex Hello World Hello World ener 3 Style bold Cl italic T small caps font size 24 px line height 30 px font family Arial sans serif text align start v Itext baseline alphabetic v 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 Alignment Left y Color Monochrome Color 1 Cut Paper Open the following URL page using the Web browser http Web server IP address canvas canvas print text html 233 2 EPSON ePOS Print Sample Program appears Set items on the right of the page The following items can be set RR NN 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 3 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 4 Set the following and click the Print button SS EE C NN NN URL Enter the following URL http
57. script gt lt script type text javascript gt 1 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 165 onbatteryok event Registers call back function and obtains remaining battery event Syntax Function Example lt script type text javascript lt script type text javascript gt xe 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 onbatteryok function alert batteryok Y epos open gt lt script gt onbatterylow event Registers call back function and obtains no remaining battery event Syntax Function Example lt script type text javascript lt script type text javascript gt 1 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 3 epos open lt script gt 166 Chapter 5 Canvas API Reference ononline event Registers a callback function to obtain a online event Object type Function Ex
58. 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 script To set 58 mm die cut label without black mark lt script type text javascript src epos print 3 x x js script lt script type text javascript gt 1 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 layout width 580 height 0 margin top offset cut 25 15 margin bottom 15 epos cut true epos print canvas lt script gt 159 To set 58 mm 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 getElementBylId 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 cu
59. the URL of the printer to send a print document to The URL is as follows http IP address of ePOS Print supported TM printer cgi bin epos service cgi devidz device ID of printer to be used for printing amp timeoutz timeout time Example script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt 1 function sendMessage var address http 192 168 192 168 cgi bin epos service cgi devid local printer var epos new epson ePOSPrint address gt lt script gt 121 send method Sends a print document created using an ePOS Print Builder object A print document is obtained by executing the toString method p 116 of the ePOS Print Builder Q object Syntax send request Parameter 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 script script type text javascript gt lt function printHellowWorld gt lt script gt var builder new epson ePOSBuilder builder addText Hello World in 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
60. type ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error Chapter 4 API Reference 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 src epos print 3 x x js script script type text javascript gt x le function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addPageLine 100 0 500 200 builder LINE THIN DOUBLE builder addPageEnd lt script gt 103 104 addCut method Adds paper cut to the command buffer Sets paper cut Not available in page mode A Syntax addCut type Parameter e type Optional parameter Object type String Specifies the paper cut type gel Cn EA A JG Cut without feeding CUT_NO_FEED The paper is cut without being fed Feed cut CUT FEED The paper is fed to the cut position and then is cut CUT RESERVE Cut reservation Printing continues until the cut position is reached at which the paper is cut undefined When not specified Feed cut The paper is fed to the cut position and then is cut Return value Return value ePOS Print Builder Object Object type ePOS Builder Exception Object type Parameter is invalid To perform feed cu
61. var request builder toString H script 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 75 37 38 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 methods into the command buffer to create print data For the end of page mode store the addPageEnd 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 script script type text javascript gt function buildMessage Create an ePOS Print Builder object var builder new epson ePOSBuilder Create a print document The page mode starts builder addPageBegin Specify the page mode print area builder addPageArea 100 50 200 100 Specify the page mode print position builder addPagePosition 0 42 Specify the print data builder addTextLang en builder addTextFont builder FONT A builder addTextSize 4 4 builder addTextStyle false false true undefined bu
62. 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 Cadet eres At the 21st dot from the top of the character Baseline Font B At the 21st dot from the top of the character Font C At the 15th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color 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 Raster Image Monochrome image Logo Monochrome image Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 GS1 128 GS1 DataBar Omnidirectional GS1 DataBar Truncated GS1 DataBar Limited GS1 DataBar Expanded 2D Code PDF417 QR Code MaxiCode CS1 DataBar Stacked 6S1 DataBar Stacked Omnidirectional GS1 DataBar Expanded Stacked Aztec Code DataMatrix Composite Symbology Not supported Ruled Line Not supported Page Mode Line Supported Only solid line Rectangle Paper Cut Cut Feed cut 215 Receipt 58 mm Receipt 60 mm Specification of the paper feed position for labels black mark Not supported paper Drawer Kick Out Not supported Buzzer Support Pattern 1 Pattern 10 Stop Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 216 Appendix Supported ePOS Print Builder API List
63. 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 Gray scale image Logo Monochrome image Gray scale image Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE339 ITF CODABAR CODE93 CODE128 GS1 128 GS1 DataBar Omnidirectional GS1 DataBar Truncated GS1 DataBar Limited GS1 DataBar Expanded 2D Code PDF417 QR Code MaxiCode GS1 DataBar Stacked GS1 DataBar Stacked Omnidirectional GS1 DataBar Expanded Stacked Ruled Line Not supported Page Mode Line Not supported Rectangle Paper Cut Cut Feed cut Specification of the paper feed position for labels black mark paper Drawer Kick Out Not supported Supported Buzzer Optional Pattern A Pattern E Error No paper Stop 187 80 mm Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported ePOS Print Setting Item Printing Method Value Thermal 180 dpi Character Code Tables Page 0 5 16 19 20 21 26 30 31 11 15 32 53 188 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page
64. 4 addTextLang method p 58 adaPagebDirection method p 96 addTextFont method p 60 addPagePosition method p 98 adaTextSmooth method p 61 addCut method p 104 addTextDouble method p 62 adaPulse method p 105 addTextSize method p 63 addRecovery method p 115 addTextStyle method p 64 addReset method p 114 adaTextPosition method p 66 addCommand method p 115 adaTextVPosition method p 67 toString method p 116 addFeedUnit method p 68 halftone property p TE addFeedLine method p 69 brightness property p 118 addFeed method p 72 force property p 119 addlmage method p 73 message property E 120 adaLogo method p 75 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 12 onstatuschange event p 132 send method p 122 ononline event p 133 open method p 123 onoffline event p 139 close method E 124 onpoweroff event p 134 address property p 125 oncoverok event p 134 enabled property p 125 oncoveropen event p 135 interval property p 126 onpaperok event p 135 status property p 126 onpapernearend event p 136 timeout property p 127 onpaperend event p 136 201 ePOS Print Object Page ePOS Print Object Page onreceive event p 128 ondrawerclosed event pk 137 onerror event p 131 ondraweropen event p 137 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 a
65. 8 cgi bin epos service cgi devid local printer var epos new epson CanvasPrint address epos oncoveropen function alert coveropen function startMonitor epos open function stopMonitor epos close gt lt script gt 144 Chapter 5 Canvas API Reference recover method Recovers from an error Recovers from errors that can be recovered from and clears the buffer Syntax recover Example script type text javascript src epos print 3 x x js script lt script type text javascript gt 1 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 li function recover epos recover gt lt script gt reset method Resets the printer Syntax reset Example lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 1 function reset epos reset lt script gt 145 address property URL of the printer Object type String Description The URL of the printer to be used for printing is specified The URL
66. 92 168 cgi bin epos service cgi devid local_printer var epos new epson CanvasPrint address epos onbatterylow function alert epos battery nn epos open gt lt script gt timeout property Specifies connection timeout Object type Number Description Specifies connection timeout with ePOS Print supported printer in milliseconas 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 src epos print 3 x x js script script type text javascript gt 1 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 timeout 60000 epos onreceive function res alert res success epos onerror function err alert err status epos print canvas gt lt script gt 148 Chapter 5 Canvas API Reference halftone property Halftone processing method 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 Th
67. AAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAAABQAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAV QAAAAAAAAAaWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGqGAAAAAAAAGUAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHGAAAAAAAAA BAAAAAAAAAAAAAAAAQgAAAAAAAAAAAAAAAAAAAAAVQBAAAAAAAAAAAAAAAAUUAAAAAAAAAAAAACAAAA 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 4 Select the Print tab 2 Check the content in the Data to be sent ePOS Print XML box and press the 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 177 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 AN Perform import operat
68. 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 1662 dots W x H Page Mode Maximum Area 512 dots x 1662 dots W x H Raster image Monochrome image Logo Monochrome image Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE3S ITF CODABAR CODE93 CODE128 2D Code PDF417 QR Code Ruled Line Not supported Character Baseline Line Not supported Rectangle Paper Cut Cut Feed cut Specification of the paper feed position for labels black mark paper Not suppetied Drawer Kick Out Supported Buzzer Not supported Paper Layout Settings Not supported Forced transmission mode Supported 195 80 mm Recovery from an error Supported Reset Supported Command Supported ePOS Print Setting Item Printing Method Thermal 180 dpi Value Character Code Tables Page 0 5 16 19 196 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 adaBarcode method p 76 ada
69. C mm aem names P X E EPSON POS Print Sample in vs 59 Canvas Bar Code Editing Position x5 y 175 Module Size w3 h 162 EAN13 JAN 13 Data 2 567890 3 Clear Reset 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 z Print Alignment Let Color Monochrome Color 1 v V Cut Paper L 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 HEELS A SE 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 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
70. COLOR Color specification HALFTONE Halftone type MODE Color mode BARCODE Barcode type HRI HRI position SYMBOL 2D code type LEVEL error correction level LINE line style DIRECTION page mode print direction GU 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 fo parameters In the ePOS Print Builder object API numerical values are set to some parameters Set values with the following in mind A Unit Specify numbers in dots for units that represent length Print position paper feed space width and height of images and barcodes etc Range Depending on the printer specifications a specifiable range is predetermined For details refer to Printer specifications p 179 A 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 specifications p 179 51 52 window epson ePOSPrint Components E NN Peseripton age Constructor ePOS Print Initializes an ePOS Print object 121 Method send Sends a message 122 open Enables status even
71. Constructor p 53 adaBarcode method p 76 adaTextAlign method p 54 addSymbol method p 81 adaTextLineSpace method p 54 adaPageBegin method p 92 adaTextRotate method p 56 addPageEnd method p 90 addText method p 57 addPageArea method p 94 addTextLang method p 58 adaPagebDirection method p 96 addTextFont method p 60 addPagePosition method p 98 adaTextSmooth method p 61 addCut method p 104 addTextDouble method p 62 adaPulse method p 105 addTextSize method p 63 addSound method p 107 addTextStyle method p 64 addRecovery method 6 113 adaTextPosition method p 66 addReset method p 114 adaTextVPosition method p 67 addCommand method p 115 addFeedUnit method p 68 toString method p 116 addFeedLine method p 69 halftone property p 17 addFeed method p 72 brightness property p 118 addlmage method p 73 force property p 119 adaLogo method p 75 message property p 120 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 12 onstatuschange event p 182 send method p 122 ononline event p 133 open method p 123 onoffline event p 139 close method E 124 onpoweroff event p 134 address property p 125 oncoverok event p 134 enabled property p 125 oncoveropen event p 135 interval property p 126 onpaperok event p 135 status property p 126 onpapernearend event p 136 timeout property p 127 onpaperend event p 136 189
72. EPSON EXCEED YOUR VISION ePOS Print SDK for JavaScript 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 API Reference Describes the ePOS Print API Canvas API Reference Describes the ePOS Print Canvas API 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 MO00073901 Rev B 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 The contents of this document are subject to change without notice Please contact us for the latest information While every precaution has taken in the preparation of this document Seiko Epson Corporation assumes no responsibility for errors or omissions 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 a
73. 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 SPP is lio ANK 35 characters ANK 36 characters ANK 33 characters 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 ot ee At the 21st dot from the top of the character Font B At the 21st dot from the top of the character Font C At the 15th dot from the top of the character Default Line Feed Space Color Specification 30 dots First color Page Mode Default Area 420 dots x 1200 dots WxH 432 dots x 1200 dots WxH 400 dots x 1200 dots WxH Page Mode Maximum Area 420 dots x 1200 dots WxH 432 dots x 1200 dots WxH 400 dots x 1200 dots WxH Raster Image Monochrome image Logo Monochrome image Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 GS1 128 GS1 DataBar Omnidirectional GS1 DataBar Truncated GS1 DataBar Limited GS1 DataBar Expanded 2D Code PDF417 QR Code MaxiCode 6S1 DataBar Stacked 6S1 DataBar Stacked Omnidirectional GS1 DataBar Expanded Stacked Aztec Code DataMatrix Composite Symbology Not supported Ruled Line Not supported
74. Font B ANK 9 dots x 17 dots W x H Font A ANK 13 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 15 th dot from the top of the character Default Line Feed Space 3 75 mm 10 15 Color Specification First color Page Mode Default Area 576 dots x 1662 dots W x H 546 dots x 1662 dots W x H 42 column mode Page Mode Maximum Area 576 dots x 1662 dots W x H 546 dots x 1662 dots W x H 42 column mode Raster Image Monochrome image Logo Monochrome image Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 GS1 128 GS1 DataBar Omnidirectional GS1 DataBar Truncated GS1 DataBar Limited GS1 Databar Expanded 223 Receipt 80 mm 2D Code PDF417 QR Code MaxiCode Data Matrix Aztec Code GS1 DataBar Stacked GS1 DataBar Stacked Omnidirectional GS1 DataBar Expanded Stacked Composite Symbology not supported Ruled Line Not supported 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 paper Supported Only for black mark paper Drawer Kick Out Not supported Buzzer Support Pattern1 Pattern 10 Stop Paper Layout Settings Supported Only for receipt paper Forced transmission mode Supported Recovery from an er
75. GA Rte 156 Onrecelve evenit arresteres FEE XX TEX FEE V E ERE ED XR EU YER T 161 MEM UM TM 164 onstatusehange Virada o i de EA e T RT 165 enbatrerysrat schange evenisse precamur aen PD Eod TE e baeo 165 onpatteryok ever shes iet itor ev y a s n re io 166 OonbatteryloW Vets teet e Pariter de deed oe eG un D GR ECC nadia 166 ONGNHIING event ut etre ien ree od nitro a n n rt cde na e a a er ava Ferr erbe RS 167 NOMINA ae aan ie aos 167 OMPOWSIOMOVEM Dies sects ninia rece tases ce retina con enerett tetris 168 ONGOVSTOK OVS NT nea seb rere e n epe ak tese 168 Oricoveropenm SVEN haar eee ta 169 ONPE Vita seiere karat eneren 169 onpapemne rend Vis tai daa tai 170 DOPPLER ae ER 170 ondrawerclosed eventa aaa idos in Ben Dae nas 171 oncdtraweropen evelil setnra cente etc e eme eer eden e e ok ent P c ve La P ed de eae 171 SPOS Print Editt PT C 173 E ePOS Print Editor Operating Environment errrsnvvnnnnnvvnnnnnvnnnnnnvnnnnnvnnnnnnnnnnnnnvnnnnnnnnnennr 173 E Displaying ePOS Print Editor rrrsnnvnnrnnnnrnnnvnnrnnnrnnnvnnnnnnnrnnvnnnnnnnnnnnnnnnnnrnnnnnnnnnnnnsnnnnennnnn 173 A 174 B Creating a Sample Code eerte etri cria iare uds 175 Print siii do ete e e uka ELT E POR HR OR D 177 IMD OM e T o 178 721 0 012 1a 0 O 179 Printer specifitahonsini uinyu 179 IMEI citt
76. 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 231 TM P60II Paper settings Label paper and black mark paper settings Before printing on label paper and black mark paper with the TM P OII it is necessary to specify the label size and feed the label a little Control while referring to the following Example ePOS Print API Create the print data var builder new epson ePOSBuilder Set the paper layout Die cut label paper mount width 58 0 mm height automatic Top margin 1 5 mm from label edge bottom margin 1 5 mm from label bottom edge Cut position 2 5 mm from label bottom edge builder addLayout builder LAYOUT LABEL 580 0 15 15 25 0 Feeds to the top of the label builder addFeedPosition builder FEED NEXT TOF Transmit the print data var epos new epson ePOSPrint url epos send builder toString Example ePOS Print Canvas API Print the Canvas var epos new epson CanvasPrint url Set the paper layout Die cut label paper mount width 58 0 mm height automatic Top margin 1 5 mm from label edge bottom margin 1 5 mm from label bottom edge Cut position 2 5 mm from label bottom edge epos paper epos PAPER LABEL epos layout width 580 height 0 margin top 15 margin bottom 15
77. M printer ePOS Print settings via the Web browser connection Q Configure the ePOS Print settings via the network Settings cannot be configured through USB h into the address bar Connect the TM printer to the network Start the web browser of the setting computer and input the TM printer IP address EpsonNet Config web version is displayed Click ePOS Print The ePOS Print screen is displayed Configure the following settings e For wireless LAN interface UB RO4 e EpsonNet Config Network Configuration Network Wireless Security SSL TLS Authentication Certificate Li ificate Configuration Network ePOS Print Version ePOS Print Enable Device ID local_printer Printing Method Thermal 180dpi Character Code Tables Page 0 5 16 19 y ePOS Print Set to Enable Default Disabled Device ID Printing Method Align with the system settings Default local printer Set in line with the connected TM printer For details see Printer specifications p 179 Character Code Table Align with the connected TM printer and set the TM printer s code page For details see Printer specifications p 179 ePOS Print Settings 28 Chapter 2 Sample Program e For mobile printer TM P 0II EpsonNet Config Configuration Network a Network ePOS Print Basic Information SNMP Version 2 2 Ra ePOS Pri
78. Message var builder new epson ePOSBuilder builder addText Hello addFeed builder addText World addFeed gt lt script gt Chapter 4 API Reference addimage method Adds raster image printing to the command buffer Prints graphics rendered in HTML5 Canvas To print a raster image at high speed specify ALIGN LEFT for the addTextAlign method p Q 54 and specify a multiple of 8 not exceeding the printer s paper width for the width parameter of this API n 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 print N 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 ex Required parameter Object type Number Specifies the horizontal start position in the print area Specifies an integer from 0 to 65535 ey Required parameter Object type Number Specifies the vertical start position in the print area Specifies an integer from 0 to 65535 e width Required parameter Object type Number Specifies the width of t
79. N 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 builder MODE MONO builder addTextLang en builder addText Thank you ln 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 Mn 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 Q save the content of the ePOS Print XML print document by copying 176 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 174 n CEES 7 _ GS E Cid D GX amp eos Print Editor x int Le EU 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 p mode mono AAAAAAAAAAAAA
80. Nr cote n NI DIGNI TIED NM LIUM CSI MI C DM MM INO 179 IEEE 183 TVH 187 TM T70II Multilanguage model emen nnns 191 Me SR 195 TM T70 Multi language model oo eene nennen 199 Me 203 MLIO minde A v vic eh Dv e Yt egt vele ete P nie ve ee P AT 207 IVER ZO a re 211 MEPGOI a eA A eG aan Ok a ra Aa 215 IMERGOI WIT Peeler aars rne tri en eere Pop CEPR CHE PERO ERR A CERRAR FREE Y ERR RI TERR 219 MP scias reiten n Coen eie pr e cec la cr n rv d ER RC P edda SEN ER ERN 223 NMV205 2 227 E Paper setting function of TM L90 nrnnnnnvnnnnnvvnnnnnnnnnnnnvnnnnnnnnnnnnnennnnnnnnnsnnnnnnnnnnnnnnnnnnnennr 231 setting Paper Wii A EEG 231 Automatic setting Of paper layout oram eee eg da 231 E TM P60II Paper settings rrrnnnnnvvrnnnnnvrnnnvnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 232 Label paper and black mark paper settings sss mms 232 Receipt paper selrings s socero ere De entrata rade e UR HD PER EET 232 E Rendering in HTML5 CANVAS ccccocccccnnccccnononcccnanenonnnnccnnnnnnnnnnn cnn cnn rre rre 233 Rendering Text canvos print text htmb i hu uvenn 233 Rendering Images canvas print image htrml sse emen 235 Rendering Graphics canvas print graph html uesssssssse meme 237 Rendering Handwritten Images canvas print hand html ssee e 239 Rendering Barcode canvas print barcode html sse eem 241 Rendering Label canvas print label htm
81. PPED msg Stop the spooler n Display in the dialog box alert msg 41 Reception of Status Event The status event notification function is used to check the printer status without printing Refer to the following 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 Builder object var builder new epson ePOSBuilder address Set an event callback function cover open epos oncoveropen function alert coveropen Y Set an event callback function paper near end epos onpapernearend function alert papernearend y Enable status event operation epos open Chapter 3 Programming Guide ePOS Print Canvas API For the ePOS Print Canvas API programming is performed based on the following work flow 1 Embedding of ePOS Print Canvas API p 43 2 Rendering in HTML5 Canvas p 44 3 Prints an Canvas image p 45 4 Reception of Print Result p 46 A status event helps check the status of the TM printer For details on the procedure refer to Reception of Status Event p 42 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 g Preparation To use the ePOS Print Canvas API place
82. RE Y FEAR VEN ER et 72 addlMage methods arican rE EE EE EEE aiaa EAA 73 addcbogo methed 3 ov deter i knuste avai De ES vee aie 75 adabBarcode retos oe ne eene ear ree Rr C reb e ER ERR Oper rr a FERE EUER AER Ha 76 adasyrmiboblmethodg cte rai neret tus i t et i ho edet e c veli er te v e vo 81 adaHLine methodist sse nnne 86 adavtineBegin method cte rita a cen ee rc a e c EL n D FR a RT d d di 88 o O dee cai i atate pe reme tad tege e dre oh IR RR ERE Ep RR UE QR PRU EE deus 90 addPagebBegin method oni eter krana t E C Y X E TE Y e 92 addPageEnd riethod ena 93 addbPageAreq MEMO insist bs ree pr einen ed e Pere d a p EFL RO ER 94 addPagebDirectiorrrrethliod c ic cerit tent eee Pr e de eto ge do e na 96 adadPagebPosition nethod 3t mt e on e o aa ea eed rad n am e HR ds 98 adaPagelLirne Mati navara tette cae rete meet eene rece lee i PE ions 100 adcdPagelsectranglemethaod oi eterne anro RE 102 add cut metod miran ret brc e ra a og e Wen qan EA E e E rc rr ER ds 104 amp adadPulse miethiodss seen TY RE wi IR TORTE DR ED Walton dO geb er n alte iler et 105 OdESOUNGIMENOG wah ethic oat eden epit beatur bieten ded ires 107 adaLayoutmethodur avatar tec ete rende dee m Dc enc e rti Fr na res 109 amp dalsecoveryroetbioglu actifs fe ro e ex pr eret Pur ias ier Pri es shes 113 addRese MENSA Kea 114 AGAGCOMMANGC Me Moiola 115 TOSNO metodar NE 116 NGIMOMES DIO org EOD ITO IO DL 117 brightnessqroperty sci erre eee 118 CS POPE trad 119
83. RIS 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 Specify the paper type Feed to Specify the paper feeding position 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 only for TM P60I TM P80 Layout Specify the label paper layout Setting become effective when Set the paper layout is checked The print result is displayed
84. Raster Image Monochrome image Logo Monochrome image Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODES9 ITF CODABAR CODE93 CODE128 GS1 128 GS1 DataBar Omnidirectional GS1 DataBar Truncated GS1 DataBar Limited GS1 DataBar Expanded 211 58 mm 2D Code PDF417 QR Code MaxiCode 6S1 DataBar Stacked GS1 DataBar Stacked Omnidirectional 6S1 DataBar Expanded Stacked Aztec Code DataMatrix Composite Symbology Not supported Ruled Line Not supported Page Mode Line Supported Only solid line Rectangle Paper 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 Pattern 1 Pattern 10 Stop Paper Layout Settings Supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 212 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 addSymbol method p 81 addTextAlign method p 54 addPageBegin method p 92 adaTextLineSpace method p 54 addPageEnd method p 90 adaTextRotate method p 56 addPageArea method p v4 addText method p 57 addPageDirection method p 96 addTextLang method p 58 addPagePosition meth
85. TextAlign method p 54 addSymbol method p 81 adaTextLineSpace method p 54 adaPageBegin method p 92 adaTextRotate method p 56 addPageEnd method p 90 addText method p 57 addPageArea method p 94 addTextLang method p 58 adaPagebDirection method p 96 addTextFont method p 60 addPagePosition method p 98 adaTextSmooth method p 61 addCut method p 104 addTextDouble method p 62 adaPulse method p 105 addTextSize method p 63 addRecovery method p 115 addTextStyle method p 64 addReset method p 114 adaTextPosition method p 66 addCommand method p 115 adaTextVPosition method p 67 toString method p 116 addFeedUnit method p 68 halftone property p TE addFeedLine method p 69 brightness property p 118 addFeed method p 72 force property p 119 addlmage method p 73 message property E 120 adaLogo method p 75 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 12 onstatuschange event p 132 send method p 122 ononline event p 133 open method p 123 onoffline event p 139 close method E 124 onpoweroff event p 134 address property p 125 oncoverok event p 134 enabled property p 125 oncoveropen event p 135 interval property p 126 onpaperok event p 135 status property p 126 onpapernearend event p 136 timeout property p 127 onpaperend event p 136 197 ePOS Print Object Page ePOS Print Object Page onreceive event p 128 ondrawe
86. VA vincia ear eiie ai AAN AG GAAR AGUA GANG 44 Prints an Canvas image wi EE EE eee reer neers 45 I eception of Print ISeSUlT ia ea icin A daa Ere Pete te pere va He a a 46 Reception of Status Event eene nennen nnne nnne ni 48 API Reference NR 49 E List Of APLUNGHONS ESOTERISMO 49 window epson ePOSBuilder Components c ccocccccccnonnnncnononnnoncnononnnnnnononn non nro non n rr nr r rana rr rn rr none nrrrrrcnnnos 49 window epson ePOSPrNTECOMPONEA Sissi todas 52 B ePOS Print Builder Object ui cid 53 CONSTUGTO mu kane e ENE NE ANS N A 53 adaTextAlign aa 1 La 010 kantta ntk n enn rr 54 adaTextLinespace Mete iuis ir A pe vri a ea i E reg 55 addlextR tate method ede eer Er 56 adalet Methodi harain rnare tte tee Deren reve eec dee c e ER Y Oe e A E 57 adalextLang MEMO HE 58 addrextFentrmethod 255a aa kausativ are GA Mad a E RR Te 60 addlextSm oth Fe bec sess seres noxae abet PP rone eren eae SO Me RR Pr dea OP S MR lo S deg 61 addrextDouble rethod 5 nicer a rene eer e re nn e aa sene een 62 addlextsize A a a aa aa aaa dais sageavbeuea aaa aa AAA aa E aa A 63 adaTextSiyle Melodic a dec ud ee es ih P o eats 64 ee A Luse cocotte enter rene Reb oen Buss iden eu veh Egg pakk bad feen 66 addtTextVPositiori meth tirer t ee ees a dad addere n d 67 addreeduUnit tnethoc ritu ON 68 addreedtLine methiod 3 eats a Pec Ere ied olden rie tree ea e a Era d 69 addFeedpPosition method EE EE 70 agddEeed rethod seem timet ae sir E SEVERE EVE YEA ER E
87. VEL 4 PDF417 error correction level 4 LEVEL 5 PDF417 error correction level 5 LEVEL 6 PDF417 error correction level 6 LEVEL 7 PDF417 error correction 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 Integer from 5 to 95 Aztec Code error correction level Default 23 Select the level according to the 2D code type Q For MaxiCode and two dimensional GS1 DataBar select LEVEL DEFAULT 83 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 2108 3 QR Code 1 to 16 3 MaxiCode Ignored 2D GS1 DataBar 2108 2 Aztec Code 210 16 3 DataMatrix 2to16 3 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 2108 ROE Magnification for width QR Code MaxiCode 2D GS1 DataBar Ignored Aztec Code DataMatrix e size Optional parameter Object type Number Specifies the 2D code maximum size Specifies an integer from 0 to 65535 2D Code type Default value Specifies the number of ev oe code words for each row QR Code a Ignored Max
88. al that came with the printer roe i ER ANK 48 characters ANK 46 characters 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 cis Hes At the 21st dot from the top of the character Font B At the 21st dot from the top of the character Font C At the 15th 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 576 dots x 738 dots W x H 560 dots x 738 dots W x H when two color printing 576 dots x 369 dots W x H 560 dots x 369 dots W x H is set Page Mode Maximum Area 576 dots x 1476 dots W x H 560 dots x 1476 dots W x H when two color printing is set 576 dots x 738 dots W x H 560 dots x 738 dots W x H 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 207 Receipt Die cut label Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 2D Code PDF417 AR Code MaxiCode Ruled Line Not supported Page Mode Line Not support
89. ample script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt 1 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 script onoffline event Registers a callback function to obtain a offline event Object type Function O Example lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 offline E epos open gt lt script gt 167 onpoweroff event Registers a callback function to obtain a non response event Object type Function 0 Example lt script type text javascript src epos print 3 x x js script lt script type text javascript gt 1 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 E epos open gt lt script gt oncoverok event Registers a callback function to obtain a cover close event Object type Function O Example lt script type text javascript src
90. ar Deletes the edited details Forced Transmission Sets forced transmission mode 175 Create a sample code as follows A Click an icon 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 p 177 f aam ENIF NES m e B Column mimus O C X amp epos Print Editor J i vr 93 Edit Preview API XML Print Setting Sample Shop Thank you n Orange Mineral water Total 1 000 Logo printing barcode printing 2D code printing ESC command buzzer sound drawer kick Q and paper cut are displayed as icons The layout may change depending on the preview settings For details refer to Setting p 174 4 Select the API tab The ePOS Print API sample code appears Use it by copying Sr Goes jam ia O Ox amp epos Print Editor um EX Edit Preview XML Print Setting ePOS Print API Sample Code var canvas document getElementByld 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 ALIG
91. b browser http Web server IP address canvas canvas 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 235 4 5 236 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 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 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 po
92. ble in page mode Vertical lines are drawn until their end is specified by ada VLineEnd p 90 Use this API function with addVLineEnd Syntax addVLineBegin x style Parameter ex 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 Object type Parameter is invalid Error Chapter 4 API Reference 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 script script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder builder addVLineBegin 100 addVLineBegin 200 builder addFeedUnit 100 builder addVLineEnd 100 addVLineEnd 200 lt script gt 89 90 addVLineEnd method Adds the end of vertical line to the command buffer Finishes drawing vertical lines Not available in
93. closed event pk 137 onerror event p 131 ondraweropen event p 137 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 color property p 153 print method p 142 onreceive event p 161 open method p 144 onerror event p 164 close method p 144 onstatuschange event p 165 recover method p 145 ononline event p 167 reset method p 145 onoffline event 6 167 address property p 146 onpoweroff event p 168 enabled property p 146 oncoverok event p 168 interval property p 147 oncoveropen event p 169 status property p 147 onpaperok event p 169 timeout property p 148 onpapernearend event p 170 halftone property p 149 onpaperend event p 170 brightness property p 150 ondrawerclosed event 171 cut property p 150 ondraweropen event E 1451 align property p 152 186 Appendix TM T70II 80 mm Interface 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 16th dot from the top of the character Default Line Feed Space
94. cript gt 1 function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addTextVPosition 120 builder addPageEnd script 67 68 addFeedUnit method Adds paper feeding in dots to the command buffer Syntax addFeedUnit unit Parameter e unit Required 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 Parameter is invalid Error Example To feed paper by 30 dots script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder builder addFeedUnit 30 H script Chapter 4 API Reference 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 Object type Parameter is invalid Error Example To feed paper by 3 lines script type text javascript src epos print 3 x x js gt lt script gt script type text javas
95. cript gt 1 function buildMessage var builder new epson ePOSBuilder builder addFeedLine 3 gt lt script gt 69 addFeedPosition method Adds label black mark paper feeding to the command buffer Control of label paper black mark paper must be done in the standard mode Q 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 Feedstothetopofthecumentlabel 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 type Parameter is invalid Error 70 Chapter 4 API Reference 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 script type text javascript gt 1 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 p
96. cript 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 Ji epos open gt lt script gt 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 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 script script type text javascript gt 1 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 127 128 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 128 Name Response message Ob
97. d Remaining battery value pater 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 162 Chapter 5 Canvas API Reference 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 script script type text javascript gt 1 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 status alert success E epos print canvas lt script gt 163 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 164 Name Communication error information Object type Object Properties of the error object proper PE Name 1 Objecttype status HTTP status Number responseText Responce text String Example To print Canvas ID myCanvas To display the HTTP status code in a message box whe
98. d p 98 adaTextSmooth method p 61 addCut method p 104 addTextDouble method p 62 adaPulse method p 105 addTextSize method p 63 addSound method p 107 addTextStyle method p 64 addRecovery method 6 113 adaTextPosition method p 66 addReset method p 114 adaTextVPosition method p 67 addCommand method p 115 addFeedUnit method p 68 toString method p 116 addFeedLine method p 69 halftone property p 17 addFeed method p 72 brightness property p 118 addlmage method p 73 force property p 119 adaLogo method p 75 message property p 120 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 12 onstatuschange event p 182 send method p 122 ononline event p 133 open method p 123 onoffline event p 139 close method E 124 onpoweroff event p 134 address property p 125 oncoverok event p 134 enabled property p 125 oncoveropen event p 135 interval property p 126 onpaperok event p 135 status property p 126 onpapernearend event p 136 timeout property p 127 onpaperend event p 136 181 ePOS Print Object Page ePOS Print Object Page onreceive event p 128 ondrawerclosed event pk 137 onerror event p 131 ondraweropen event p 137 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 align property p 152 print method p 142 onreceive event p 161 open m
99. ddTextLineSpace linespc Parameter 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 lt function buildMessage var builder new epson ePOSBuilder builder addTextLineSpace 30 script 55 addTextRotate method Adds the text rotation setting to the command buffer When using the standard mode specify addTextAlign in Position at the beginning of lines This API setting also applies to barcodes 2D codes Q 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 96 instead of this API function Syntax addTextRotate rotate Parameter rotate Required parameter Object type Boolean Specifies whether to rotate text FEE L N A ee true or 11 Specifies rotated printing of text false or 0 default Cancels rotated printing of text Return value Object type ePOS Print Builder Object ePOS Bu
100. der builder addPageBegin builder addPageLine 100 0 500 0 builder LINE THIN builder addPageEnd lt script gt 101 102 addPageRectangle method Adds rectangle drawing in page mode to the command buffer Draws a rectangle in page mode 2 Use this API function by inserting it between addPageBegin p 92 and addPageEnd p 93 Syntax 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 Specifies 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 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 Object
101. e 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 1 mm Specifies an integer from 290 to 600 height Optional parameter Object type Number When not specified 0 Specifies paper height in units of 0 1 mm Paper Type Valid value range Receipt Set t without black mark Sen A Distance from the top of Receipt with black mark black mark to the top of next black mark Die cut label 0 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 e margin top Optional parameter Object type Number When not specified 0 Specifies top margin in units of 0 1 mm Paper Type Valid value range Receipt without black mark 9 Sep neInSces ay Dist f the t f Receipt with black mark 150 to 1500 oa oa nme a ake black mark Die cut label Distance from the top of to I t without black mark ad label Die cut label Distance from the bottom of 15 to 1 E with black mark d black mark 109 4 e margin bottom Optional parameter Object type Number When not specified 0 Specifies bottom margin in units of 0 1 mm Paper Type Valid value range
102. eate a page mode print document p 38 3 Transmission of Print Document p 39 4 Reception of Print Result p 40 ePOS Print supported TM printer checks the status of the TM printer to be used for printing and then starts printing operation A status event helps check the status of the TM printer For details on the procedure refer to Reception of Status Event p 42 2 Chapter 3 Programming Guide Embedding of ePOS Print SDK for JavaScript This describes embedding of ePOS Print SDK for JavaScript The file name is epos print 3 x x js Preparation To use the ePOS Print 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 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 var builder new epson ePOSBuilder Embed lt script gt lt head gt lt body gt lt body gt lt html gt 35 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 Fo
103. ecute this API function and NH specify PATTERN_NONE for pattern 107 108 e cycle Optional parameter Object type String When not specified 1000 Specifies the buzzer sounding cycle in units of milliseconds 1000 to 25500 Description 1000 to 25500 milliseconds undefined 1000 milliseconds S PATTERN A to PATTERN E PATTERN ERROR PATTERN PAPER END is disregarded Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Parameter is invalid Example To repeat the sound pattern A three times Object type Error lt script type text javascript lt script type text javascript gt lt function buildMessage script var builder new epson ePOSBuilder builder addSound builder PATTERN A src epos print 3 x x js gt lt script gt 3 Chapter 4 API Reference addLayout method Adds paper layout information to the 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 Description LAYOUT_RECEIPT Receipt without black mark LAYOUT_RECEIPT_BM Receipt with black mark LAYOUT_LABEL Di
104. ed 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 ePOS Print Setting ltem Value Printing Method Thermal 203 dpi Character Code Tables Page 0 5 16 19 208 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 adaBarcode method p 76 adaTextAlign method p 54 addSymbol method p 81 adaTextLineSpace method p 54 adaPageBegin method p 92 adaTextRotate method p 56 addPageEnd method p 90 addText method p 57 addPageArea method p 94 addTextLang method p 58 adaPagebDirection method p 96 addTextFont method p 60 adaPagePosition method p 98 adaTextSmooth method p 61 addCut method p 104 addTextDouble method p 62 adaPulse method p 105 addTextSize method p 63 addSound method p 107 adaTextStyle method p 64 adaLayout method p 109 addTextPosition method p 66 addRecovery method p 113 adaTextVPosition method p 67 addReset method p 114 addFeedUnit method p 68 addCommand method p 15 addFeedLine method p 69 toString method p 116 addFeedPosition method p 70
105. en two color printing is set 360 dots x 415 dots W x H 512 dots x 415 dots W x H Page Mode Maximum Area 360 dots x 1662 dots W x H 512 dots x 1662 dots W x H when two color printing is set 360 dots x 831 dots W x H 512 dots x 831 dots W x H 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 Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 GS1 128 2D Code PDF417 QR Code Ruled Line Not supported Page Mode Line Not supported Rectangle Paper Cut Cut Feed cut Specification of the paper feed position for labels black mark paper Not supported 183 58 mm 80 mm 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 ePOS Print Setting Item Value Printing Method Thermal 180 dpi Character Code Tables Page 0 5 16 19 184 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 adaBarcode method p 76 adaTextAli
106. ent or medical equipment related to direct medical care etc please make your own judgment on this product s suitability after a full 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 SDK for JavaScript system or developing designing an ePOS Print printer application Manual Content The manual is made up of the following sections Chapter 1 Overview Chapter 2 Sample Program Chapter 3 Programming Guide Chapter 4 API Reference Chapter 5 Canvas API Reference Chapter 6 ePOS Print Editor Appendix Printer specifications Paper setting function of TM L90 TM P60II Paper settings Rendering in HTML5 Canvas Contents FOr Sate y ESTE See ee esas caesar AEE ee See eee rn 3 Key TOS YMDOIS vs EE 3 B Restriction of USE cion ic di dic din 3 About this Manual circa ie 4 Aim Of the Manual it E 4 Manual Contrario E E r RR EE Cte CR dede NOR yes 4 Contents iii ii E 5 SEE EE 11 B Overview of ePOS Prinl 52 1 onec Eee ia 11 FOQTUIGS divi E M 12 B Operating Environment in 14 Applications enwvirenreb uso eis oae e on e e PC EAR ERE REPRE EE DECORE CARERE d PR Ee TOES 14 IMPI alo IA iria ba 14 B Provided Article EEE iia 15 PAS D ES 15 OMS MONUG PE 15 SempleProgrelri sues verb er eR D eb OR AQ ttes re awn
107. epos print 3 x x js script script type text javascript gt 1 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 E epos open gt lt script gt 168 Chapter 5 Canvas API Reference oncoveropen event Registers a callback function to obtain a cover open event 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 var epos new epson CanvasPrint address epos oncoveropen function alert coveropen 3 epos open gt lt script gt onpaperok event Registers a callback function to obtain a paper remaining event Object type Function Q 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 169 onpapernearend event Registers a callback function to obtain a paper near end event Object type Function 0 Example
108. er addPageBegin builder addPageArea 0 0 300 300 builder addPagePosition 0 299 builder addImage context 0 0 300 300 builder addPageEnd Chapter 4 API Reference 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 TMFLogo register a logo in the printer Q in advance n page mode a logo is laid out in the current print position with the reference point being its bottom left dot Syntax addLogo keyl 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 type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error Example lt script type text javascript src epos print 3 x x js script script type text javascript gt Xie function buildMessage var builder new epson ePOSBuilder builder addLogo 48 48 script 75 76 addBarcode method Adds barcode printing to the command buffer bottom left dot except for HRI SN In page mode a barcode is laid out in the current print position with
109. er API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 adaBarcode method p 76 adaTextAlign method p 54 addSymbol method p 81 adaTextLineSpace method p 54 adaPageBegin method p 92 adaTextRotate method p 56 addPageEnd method p 90 addText method p 57 addPageArea method p 94 addTextLang method p 58 adaPagebDirection method p 96 addTextFont method p 60 addPagePosition method p 98 adaTextSmooth method p 61 addCut method p 104 addTextDouble method p 62 adaPulse method p 105 addTextSize method p 63 addSound method p 107 addTextStyle method p 64 addRecovery method 6 113 adaTextPosition method p 66 addReset method p 114 adaTextVPosition method p 67 addCommand method p 115 addFeedUnit method p 68 toString method p 116 addFeedLine method p 69 halftone property p 17 addFeed method p 72 brightness property p 118 addlmage method p 73 force property p 119 adaLogo method p 75 message property p 120 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 12 onstatuschange event p 182 send method p 122 ononline event p 133 open method p 123 onoffline event p 139 close method E 124 onpoweroff event p 134 address property p 125 oncoverok event p 134 enabled property p 125 oncoveropen event p 135 interval property p 126 onpaperok event p 135 status
110. er 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 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 end sensor 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 ASB_SPOOLER_IS_STOPPED The spooler has stopped Not used Value of battery Status of power volue eatery Ox30XX The AC adapter is connected Ox31XX The AC adapter is connected Remaining battery value eatery 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 S 0 is shown when the model doesn t have a battery installed 129 4 Example To create and send a print document To display the print result in a message box script type text javascript src
111. ernearend event Registers a callback function to obtain a paper near end event Object type Function 0 Example lt script type text javascript src epos print 3 x x js script script type text javascript gt lt P gt lt script gt 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 3 epos open onpaperend event Registers a callback function to obtain a paper end event Object type Function O Example script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 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 3 epos open gt lt script gt 136 Chapter 4 API Reference ondrawerclosed event Registers a callback function to obtain a drawer close event Object type Function Example lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 scr
112. es the horizontal scale of text Integer from 1 to 8 Horizontal scale default 1 undefined x JE Retains the current setting for the horizontal scale When not specified height Optional parameter Object type Number Specifies the vertical scale of text Integer from 1 to 8 Vertical scale default 1 undefined Retains the current setting for the vertical scale When not specified Return value Return value 0 Ted 41013 ePOS Print Builder Object ePOS Builder Exception 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 script script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextSize 4 4 lt script gt 63 64 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 MERECE eee CIA Specifies the inversion of black and white parts true or 1 of characters E Is the i j f black hit t EGGEN ancels the inversion of black and white parts of characters undefined Retains the current setting for inversion of black Whe
113. ethod p 144 onerror event p 164 close method p 144 onstatuschange event p 165 recover method p 145 ononline event p 167 reset method p 145 onoffline event 6 167 address property p 146 onpoweroff event p 168 enabled property p 146 oncoverok event p 168 interval property p 147 oncoveropen event p 169 status property p 147 onpaperok event p 169 timeout property p 148 onpapernearend event p 170 halftone property p 149 onpaperend event p 170 brightness property p 150 ondrawerclosed event 171 cut property p 150 ondraweropen event I mode property p 151 182 TM T88IV Appendix 58 mm 80 mm Interface Wireless LAN Resolution 180 dpi x 180 dpi W x H Print Width 360 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 Line Font A ANK 30 characters ANK 42 characters Font B ANK 40 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 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 Color Specification 30 dots First color First color Second color when two color printing is set Page Mode Default Area 360 dots x 831 dots W x H 512 dots x 831 dots W x H wh
114. function buildMessage Create an ePOS Print Builder object var builder new epson ePOSBuilder Create a print document Configure the print character settings builder addTextLang en builder addTextSmooth true builder addTextFont builder FONT A builder addTextSize 4 4 builder addTextStyle false false true undefined lt Specify the print data gt builder addText Hello tWorld n builder addCut builder CUT FEED Acquire the print document var request builder toString j lt script gt To create a graphic print document To create a graphic print document store a raster image obtained by rendering an image in HTML5 Canvas into the command buffer using the addimage method Refer to the following program To create a print document for the image file logo bmp script type text javascript src epos print 3 x x js gt lt script gt 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 getElementById 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
115. g 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 2D code Specify the top left of the symbol This can be omitted when printing from the top left Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error Chapter 4 API Reference 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 script script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addPageArea 100 50 200 100 builder addPagePosition 50 30 builder addText ABCDE builder addPageEnd lt script gt 99 100 addPageLine method Adds line drawing in page mode to the command buffer Draws a line in page mode AN S Syntax Diagonal lines cannot be drawn Use this API function by inserting it between addPageBegin p 92 and addPageEnd p 93 addPageLine x1 yl x2 y2
116. g the ePOS Print API 17 18 EE AS PR CA 4 Settings IP address of ePOS Print supported printer 192 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 OK Cancel Displays the Settings screen The screen is used to set the following e IP address 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 Default No e Prints labels with specified layout Label Default No Chapter 2 Sample Program Print Image The sample program prints the following Your Number ePOS Print API Sample Stop Matsumoto Nagano Your Number 0001 Please wait until your ticket number is cal led Mon Aug 01 2011 16 18 00 HALE Label ePOS Print APD Name ten Color Red Code EMINENTNI 2012001 Die cut label mount width 58 mm or above Label size width 54 mm x height 25 4 mm or above Coupon ePOS Print Canvas API No 012301 Sample Shop Expires Mon Aug 01 2011 Sample Shop 16 27 24 19
117. gn method p 54 addSymbol method p 81 adaTextLineSpace method p 54 adaPageBegin method p 92 adaTextRotate method p 56 addPageEnd method p 90 addText method p 57 addPageArea method p 94 addTextLang method p 58 adaPagebDirection method p 96 addTextFont method p 60 addPagePosition method p 98 adaTextSmooth method p 61 addCut method p 104 addTextDouble method p 62 adaPulse method p 105 addTextSize method p 63 addRecovery method p 115 addTextStyle method p 64 addReset method p 114 adaTextPosition method p 66 addCommand method p 115 adaTextVPosition method p 67 toString method p 116 addFeedUnit method p 68 halftone property p TE addFeedLine method p 69 brightness property p 118 addFeed method p 72 force property p 119 addlmage method p 73 message property p 120 adaLogo method p 75 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 12 onstatuschange event p 182 send method p 122 ononline event p 133 open method p 123 onoffline event p 139 close method E 124 onpoweroff event p 134 address property p 125 oncoverok event p 134 enabled property p 125 oncoveropen event p 135 interval property p 126 onpaperok event p 135 status property p 126 onpapernearend event p 136 timeout property p 127 onpaperend event p 136 185 ePOS Print Object Page ePOS Print Object Page onreceive event p 128 ondrawer
118. gnment Left y Color Monochrome Color 1 Cut Paper 4 Open the following URL page using the Web browser http Web server IP address 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 a To erase the drawn image click the Clear button 239 4 Set the following and click the Print button AA AA A URL Enter the following URL http IP address of 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 Aajust the brightness Samma 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 240 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 1 43G3S J 8
119. he 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 416 dots x 1662 dots W x H 576 dots x 1662 dots W x H Page Mode Maximum Area 416 dots x 1662 dots W x H 576 dots x 1662 dots W x H Raster image Monochrome image Logo Monochrome image Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 2D Code PDF417 QR Code Ruled Line Not supported Page Mode Line Not supported Rectangle Paper Cut Cut Feed cut Specification of the paper feed position for labels black mark paper Norsupponeg Drawer Kick Out Supported Buzzer Not supported Paper Layout Settings Not supported 199 58 mm 80 mm Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported ePOS Print Setting Item Value Printing Method Thermal 203 dpi Character Code Tables Page 0 5 16 19 200 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 adaBarcode method p 76 adaTextAlign method p 54 addSymbol method p 81 adaTextLineSpace method p 54 adaPageBegin method p 92 adaTextRotate method p 56 addPageEnd method p 90 addText method p 57 addPageArea method p 9
120. he 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 Specifies the color COLOR NONE Characters are not printed COLOR 1 default First color COLOR 2 Second color COLOR 3 Third color COLOR 4 Fourth color undefined First color When not specified e mode Optional parameter Object type String Specifies the color mode MODE_MONO Monochrome two tone MODE_GRAY16 Gray scale 16 tone undefined Monochrome two tone When not specified T3 Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception 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 canvas document getElementBylId canvas if canvas getContext var context canvas getContext 2d builder addImage context 0 0 canvas width canvas height gt lt script gt To print an image 300 dots wide and 300 dots high in page mode var canvas document getElementByld myCanvas var context canvas getContext 2d var builder new epson ePOSBuilder build
121. height O margin top 15 margin bottom 15 offset cut 25 offset label 0 A A A Open the following URL page using the Web browser http Web server IP address canvas canvas print label html 2 EPSON ePOS Print Sample 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 EAN1I3 JAN 13 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 243 244 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 5 Description URL Enter the following URL http IP address of 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 tere A GESSETS
122. heir end is specified by addPageEnd p 93 Use Q this API function with addPageEnd Syntax addPageBegin Return value Object type ePOS Print Builder Object ePOS Builder Example To print the characters ABCDE in page mode script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addText ABCDE builder addPageEnd H script Chapter 4 API Reference addPageEnd method Adds the end of page mode to the command buffer The page mode process ends Q Use this API function with addPageBegin p 92 Syntax addPageEnd Return value Object type ePOS Print Builder Object ePOS Builder Example To print the characters ABCDE in page mode script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addPageBegin builder addText ABCDE builder addPageEnd gt lt script gt 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 Specify a print area to cover the content to be p
123. iCode Specifies the maximum 2D GS1 DataBar 0 Auto width for the barcode 106 or above Aztec Code Ignored DataMatrix Others Ignored Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error Chapter 4 API Reference Example To print 2D codes lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 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 23 builder addSymbol ABCDE builder SYMBOL DATAMATRIX SQUARE H script 85 86 addHLine method Adas horizontal line printing to the command buffer Draws horizontal lines Not available in page mode Syntax addHLine x1 x2 style Parameter e xL Required parameter Object type
124. ified 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 script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt 1 var address http 192 168 192 168 cgi bin epos service cgi devid local printer var epos new epson CanvasPrint address epos interval 1000 epos oncoveropen function alert coveropen epos open gt lt script gt status property Hold the TM printer s status Object type 5 Number Description This is the status last obtained from the printer This is read only Default value 0 Example script type text javascript src epos print 3 x x js gt lt script gt 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 3 epos open gt lt script gt 147 battery property Hold the TM printer s battery status Object type Number Description Battery status obtained from the last printer status This is read only Default value 0 Example lt script type text javascript src epos print 3 x x js script script type text javascript gt gise var address http 192 168 1
125. ilder 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 script lt script type text javascript gt eben function buildMessage var builder new epson ePOSBuilder builder addTextRotate true gt lt script gt Chapter 4 API Reference addText method Adds the printing of text to the command buffer In page mode characters are laid out in the current print position with the reference point being N the character baseline dot Printer specifications p 179 After printing text to print content other than text execute line feed or paper feed Syntax addText data Parameter data Required parameter Object type String Specify a character string to be printed For the horizontal tab line feed use the following escape sequences EE SME De e S M Horizontal tab HT n Line feed LF Carriage return Return valueReturn value Object type ePOS Print Builder Object ePOS Builder Exception Object voe Parameter is invalid Error Example To add character strings lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder builder addText Hello t addTe
126. ilder 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 Chapter 3 Programming Guide 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 address refer to Printer End Point Address p 39 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 script type text javascript src epos print 3 x x js gt lt script gt 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 Transmission of print document var request builder toString 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 add
127. ion Object type Parameter is invalid Error Chapter 4 API Reference Example To print the characters ABCDE by rotating them 90 degrees clockwise lt script type text javascript src epos print 3 x x js script script type text javascript gt lt 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 lt script gt 97 98 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 S Use this API function by inserting it between addPageBegin p 92 and addPageEnd p 93 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 Required parameter Object type Number Specifies the vertical print position in dots Specifies an integer from 0 to 65535 S Specify the print start position coordinates according to the content to be printed Refer to the following To print a character string Specify the left end of the baseline for the first character This can be omitted for left aligned printin
128. ion using ePOS Print XML print data Mu Mu IMA E EER Lang Font Position Position x ge ve Y a E Import x Smooth Size Del Data to be import ePOS Print XML Text pri Paper Feed lt epos print xmlns http www epson E Unit Line E pos com schemas 2011 03 epos print gt E By Unit By lt text align center gt lt image width 256 height 60 color color_i Image mode mono AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ARARNAR ALARA ERRAN AAN EEDA MA RAMAA MAA CAMARMA zs Im NV Log Bar Code AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA x AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA EE mbo Sy Apply x zt ode Page Information x The import process has been completed 1 H AC MH gt Others l EH Close carurceu rramnmission pver 3 0 arpOrt Clear Description 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 Print Editor can import an ePOS Print XML print document as follows A Select the Edit tab and click the Import button The Import screen appears Paste the ePOS Print XML print document in the Data to be import ePOS Print XML box 2 3 Click the Apply button 4
129. ipt gt ondraweropen event Registers a callback function to obtain a drawer open event Object type Function Q Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 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 137 onbatteryok event Registers call back function and obtains remaining battery event Object type Function O Example lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 onbatterylow event Registers call back function and obtains no remaining battery event Object type Function 0 Example script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 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 batterylow Y epos open gt lt scr
130. ipt gt 138 Chapter 5 Canvas API Reference Canvas API Reference This chapter describes the ePOS Print Canvas API Concerning ePOS Print API see API Reference p 49 List of ePOS Print Canvas API functions The ePOS Print Canvas API provides the following object 11 ePOS Print Canvas API window epson CanvasPrint object p 139 window epson CanvasPrint Components Constructor CanvasPrint Initializes an ePOS Print Canvas API object 141 method print Prints an HTML5 Canvas image 142 open Enables status event operation 144 close Disables status event operation 144 recover Recovers from an error 145 reset Resets the printer 145 Property adaress URL of the printer 146 enabled Enabling disabling of status event 146 interval Printer status update interval 147 status Status 147 battery Battery status 148 timeout Connection timeout 148 halftone Raster image halftone processing method 149 brightness Raster image brightness correction value 150 cut Paper cut 150 Property mode Color mode 151 align Position alignment 152 color Printing color 153 feed Control of label paper black mark paper 154 paper Type of papers 189 layout Paper layout 156 Event onreceive Response message receipt event 161 onerror Communication error event 164 onstatuschange Status change event 165 onbatterystatuschange Battery status change event 165 139
131. ipt type text javascript src epos print 3 x x js script 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 lt script gt 95 96 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 S Use this API function by inserting it between addPageBegin p 92 and addPageEnd p 93 Syntax addPageDirection dir Parameter dir Required parameter Object type String Specifies the print direction in page mode Constant di DIRECTION LEFT TO RIGHT default Left to right No rotation Data is printed from the top left corner to the right DIRECTION BOTTOM TO TOP Bottom to top Counterclockwise rotation by 90 degrees Data is printed from the bottom left corner to the top DIRECTION RIGHT TO LEFT Right to left Rotation by 180 degrees Data is printed from the bottom right corner to the left DIRECTION TOP TO BOTTOM Top to bottom Clockwise rotation by 90 degrees Data is printed from the top right corner to ihe bottom Return value Return value ePOS Print Builder Object Object type ePOS Builder Except
132. ject type Object Properties of the response object propery Name Opjeciiype success p 128 Print result Boolean code p 128 Error code String status p 129 Status Number battery p 129 Battery status Number e Value of success true or 1 Printing succeeded false or 0 Printing failed e Value of code EPTR AUTOMATICAL EPTR COVER OPEN An automatically recoverable error occurred A cover open error occurred 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 SchemaError The request document contains a syntax error The printer with the specified device ID does not DeviceNotFound EXE PrintSystemError An error occurred on the printing system EX BADPORT An error was detected on the communication port EX TIMEOUT A print timeout occurred Value of status Constant status ASB_NO_RESPONSE Chapter 4 API Reference 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 ASB_OFF_LINE Offline ASB_COVER_OPEN The cover is open ASB_PAPER_FEED Pap
133. k mark mark to the bottom of label Valid value of range is depending on the printer model For detail refer to Appendix Printer Specifications 157 158 Layout property positions that can be designated for each type of paper Receipt lt without Black Mark gt lat sf PI Bottom edge of print area u Mark Parameter sf width sa height sb margin_top se margin_bottom sc offset_cut sd offset_label Top position pp Sa Cut 7 Cut Top position Bottomedge of label with Black Mark sf sa Ey m F m Bottom edge se sal of print area sd Standard eject Hy Y rr SC x Chapter 5 Canvas API Reference Example To set 58 mm receipt without black mark lt script type text javascript src epos print 3 x x js script 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 paper epos PAPER_RECEIPT epos layout width 580 epos cut true epos print canvas gt lt script gt To set 58 mm receipt with black mark lt script type text javascript src epos print 3 x x js gt lt script gt lt
134. lign property p 152 print method p 142 onreceive event p 161 open method p 144 onerror event p 164 close method p 144 onstatuschange event p 165 recover method p 145 ononline event p 167 reset method p 145 onoffline event 6 167 address property p 146 onpoweroff event p 168 enabled property p 146 oncoverok event p 168 interval property p 147 oncoveropen event p 169 status property p 147 onpaperok event p 169 timeout property p 148 onpapernearend event p 170 halftone property p 149 onpaperend event p 170 brightness property p 150 ondrawerclosed event 171 cut property p 150 ondraweropen event I 202 Appendix TM T90 refer to the user s manual that came with the printer 58 mm 60 mm 80 mm Interface Wireless LAN Resolution 180 dpi x 180 dpi W x H Print Width 360 dots 384 dots 512 dots Font A Font B Font For more information about what character codes can be printed Characters in a Color Specification First color Second color when two color printing is set iini Font A ANK 30 characters ANK 32 characters ANK 42 characters 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 S Tasten Font A At the 21st dot from the top of the character Baseline Font B At the 16th dot from the top of the character Default Line Feed Space 30 dots Fi
135. 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 request 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 button onclick buildMessage gt Run lt button 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 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 Fail
136. method p 124 onoffline event p 133 adaress property p 125 onpoweroff event p 134 enabled property p 125 oncoverok event p 134 interval property p 126 oncoveropen event p 135 225 ePOS Print Object Page ePOS Print Object Page status property p 126 onpaperok event pe 135 battery property 127 onpapernearend event p 136 timeout property lor onpaperend event p 136 onreceive event p 128 onbatteryok event p 138 onerror event p 131 onbatterylow event p 138 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 paper property p 185 print method p 142 layout property ps 186 open method p 144 onreceive event p 161 close method p 144 onerror event p 164 recover method p 145 onstatuschange event p 165 reset method p 145 onbatterystatuschange event p 165 address property p 146 onbatteryok event p 166 enabled property p 146 onbatterylow event p 166 interval property p 147 ononline event p 167 status property p 147 onoffline event p 167 battery property p 148 onpoweroff event p 168 timeout property p 148 oncoverok event p 168 halftone property p 149 oncoveropen event p 169 brightness property p 150 onpaperok event p 169 cut property p 150 onpapernearend event 170 align property p 152 onpaperend event p 170 feed property p 154
137. n a communication error occurs script type text javascript src epos print 3 x x js script 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 3 epos print canvas script 164 Chapter 5 Canvas API Reference onstatuschange event Registers a callback function to obtain a status change event Syntax Function status Parameter of the callback function Parameters status Name Status Object type Number Example lt script type text javascript src epos print 3 x x js script 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 onstatuschange function status alert status Y epos open gt lt script gt onbatterystatuschange event Registers call back function and obtains battery status change event 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
138. n not specified and white e ul Optional parameter Object type Boolean Specifies the underline style DENS E APA SC A true or 1 Specifies underlining false or 0 default Cancels underlining undefined 1 Retains the current underlining setting When not specified e em Optional parameter Object type Boolean Specifies the bold style GE c A e cca true or 1 Specifies emphasized printing of characters false or 0 default Cancels emphasized printing of characters undefined Retains the current setting for emphasized print When not specified ing e color Optional parameter Object type String Specifies the color COLOR NONE Characters are not printed COLOR 1 default First color COLOR 2 Second color COLOR 3 Third color COLOR 4 Fourth color undefined j Retains the current color setting When not specified Chapter 4 API Reference Return value Return value Object type 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 lt script gt 65 66 addTextPosition method Adds the hori
139. nal Terminal with an HTML5 supported Web browser 23 Environment Settings 24 A flow for configuring the environment settings for the sample program is shown as follows The TM printer network settings can be easily configured by connecting with the TM printer via Q USB and using EpsonNet Config utility Download EpsonNet Config in advance 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_Sample_JS_V3 x xE zip p 25 4 Terminal settings Configure the wireless LAN Wi Fi settings 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 TM printer p 26 Connect the computer and TM printer by USB cable and configure settings from EpsonNet Config Chapter 2 Sample Program 6 TM printer ePOS Print settings p 28 Configure settings from the computer Web browser via the network 7 Sample Program Settings p 30 Configuration is done from a Web browser these settings are not required in this sample program Registration of Sample P
140. ndustry s initiatives with its own POS printer command system ESC POS ESC POS has a large number of commands including patented ones Its high scalability enables users to build versa tile 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 friendli ness is valued around the world Q Seiko Epson Corporation 2014 All rights reserved For Safety Key to Symbols 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 AN 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 equipm
141. nitor the status When this check box is checked the printer s status is monitored 174 Chapter 6 ePOS Print Editor Creating a Sample Code Select the Edit tab to display the Edit screen Create an ePOS Print API sample code in the Edit screen LEN OE uum p ox amp epos Print Editor Preview Common Linespc Rotate Text Printer Font E m E n o 3 API XML Print Setting E Alignment Center EJ Image File on the Server Side Ta Load Sample Shop Scale to Fit Paper Width Mode Monochrome Brightness 1 0 Position Color Monochrome Color ilz Halftone Monochrome Error Diffusion z Language ANK un Lang Thank youl Yn Text Lines 2 Text Mineral water n E LF E Alignment Left X Position 30 TotalYtYt Yt Yt 41 000 Yn Text E Forced Transmission Ver 3 0 Import Clear Menu area Edit area AAA AAA 2 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 178 Cle
142. nt Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 adaBarcode method p 76 adaTextAlign method p 54 addSymbol method p 81 adaTextLineSpace method p 54 adaPageBegin method p 92 adaTextRotate method p 56 addPageEnd method p 90 addText method p 57 addPageArea method p 94 addTextLang method p 58 adaPagebDirection method p 96 addTextFont method p 60 addPagePosition method p 98 adaTextSmooth method p 61 addCut method p 104 addTextDouble method p 62 adaPulse method p 105 addTextSize method p 63 addSound method p 107 addTextStyle method p 64 addRecovery method 6 113 adaTextPosition method p 66 addReset method p 114 adaTextVPosition method p 67 addCommand method p 115 addFeedUnit method p 68 toString method p 116 addFeedLine method p 69 halftone property p 17 addFeed method p 72 brightness property p 118 addlmage method p 73 force property p 119 adaLogo method p 75 message property p 120 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 12 onstatuschange event p 182 send method p 122 ononline event p 133 open method p 123 onoffline event p 139 close method E 124 onpoweroff event p 134 address property p 125 oncoverok event p 134 enabled property p 125 oncoveropen event p 135 interval property p 126 onpaperok event p 135
143. nt M ePOS Print Device ID local_printer Network Authentication Set to Enable Default Disabled ePOS Print Align with the system settings Device ID Default local printer 4 Click Send 5 Turn the TM printer s power off and on again 29 30 Sample Program Settings Configure the settings for the sample program according to the procedure below 2 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 AR ON The sample program page opens Click Settings AS JE p O ex ep0s print x DUE ePOS Print Demo Queue Ticket Coupon Label Settings Chapter 2 Sample Program 5 The Settings screen appears Specify the following and click OK IP address of ePOS Print supported printer 192 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 OK Cancel Specifies the IP address of the TM printer IP f the TM t RE Default value 192 168 192 168 Specifies the Device ID of the TM printer Default value local printer
144. od p 98 addTextFont method p 60 addPageLine method p 100 adaTextSmooth method p 61 addPageRectangle method p 102 addTextDouble method p 62 addCut method p 104 addTextSize method p 63 addSound method p 107 addTextStyle method p 64 addLayout method p 109 addTextPosition method p 66 addRecovery method p 113 adaTextVPosition method p 67 addReset method p 114 addFeedUnit method p 68 addCommand method p 15 addFeedLine method p 69 toString method p 116 addFeedPosition method p 70 halftone property 6117 addFeed method p 12 brightness property p 118 addlmage method p force property p 119 adaLogo method p 75 message property p 120 addBarcode method p 76 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 121 onstatuschange event p 132 send method p 122 onbatterystatuschange event p 132 open method p 123 ononline event p 133 close method p 124 onoffline event p 133 adaress property p 125 onpoweroff event p 134 enabled property p 125 oncoverok event p 134 interval property p 126 oncoveropen event p 135 213 ePOS Print Object Page ePOS Print Object Page status property p 126 onpaperok event pe 135 battery property 127 onpapernearend event p 136 timeout property lor onpaperend event p 136 onreceive event p 128 onbatteryok event p 138 onerror event p 131 onbatterylow event p 138 Supported ePOS Print Canvas API List
145. on function is used to check the printer status without printing Refer to the following 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 an event callback function cover open epos oncoveropen function alert coveropen Ji Set an event callback function paper near end epos onpapernearend function alert papernearend he Enable status event operation epos open API Reference This chapter describes the ePOS Print API Chapter 4 API Reference Concerning ePOS Print Canvas API see Canvas API Reference p 139 List of API functions ePOS Print provides the following objects 4 ePOS Print Builder window epson ePOSBuilder Object p 49 4 ePOS Print window epson ePOSPrint Object p 52 window epson ePOSBuilder Components O Available Not available 9 Q le FE Description D E O O 0 o c O 5 ja eo Constructor ePOS Builder Initializes an ePOS Print XML Builder object O e 53 Method addTextAlign Adds a tag for the text alignment setting e 54 addTextLineSpace Adds a tag for the line feed space setting 55 addTextRotate Adds a tag for the text rotation setting e 56 adaText Adds a tag for p
146. oo emen 243 10 Chapter 1 Overview Overview This section gives an outline of ePOS Print SDK for JavaScript and describes the operating environment provided articles and restrictions Overview of ePOS Print ePOS Print SDK for Javascript is intended for developers of Web applications for printing with EPSON TM printers Applications are developed using the API provided with ePOS Print SDK Different versions of ePOS Print SDK are ePOS Print SDK for iOS applications and ePOS Print SDK for Android applications 2 XML data 1 HTML HTIP emu Nan B a te Web Server Terminal TM Printer Web Application Web Browser 1 From Web server web applications JavaScript for printing is embedded in HTML data sent to terminals 2 The terminal web browser transmits XML print data to the TM printer 11 12 2 The installed functions vary depending on the model For details refer to Appendix p 179 ePOS Print SDK for JavaScript contains the following printing methods These may be used successively within a single document however they cannot be used simultaneously 3 ua ePOS Print API This is suited to mainly text printing Printing is done with the device font mounted on the TM printer Barcodes can also be printed upon developing them as images on the TM printer side ePOS Print Canvas API Highly expressive printing is possible Images painted on HTML5 Canvas are printed
147. os 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 cut true epos print canvas script 150 Chapter 5 Canvas API Reference 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 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 gt lt script gt 151 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 script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt
148. osition lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 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 154 Chapter 5 Canvas API Reference paper property It sets paper type 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 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 155 layout property It sets paper layout Object type Object Description It specifies paper layout Property of layout being setup Property Object type width
149. ow to specify CODE C gt 2 GS1 DataBar Omnidi rectional GS1 DataBar Truncated GS1 DataBar Limited Specify a 13 digit global trade item number GTIN not including an application identifier AI or a check digit GS DataBar Expanded 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 lt How to specify special characters gt 77 78 To specify binary data that cannot be represented by character strings use the following escape sequences PEER EE E CIL I ge NN xnn Control code Back slash 1 How to specify Code128 special characters Specified character string FNCI C FNC2 2 FNC3 3 FNCA A CODE A A CODEB B CODEC SHIFT S 2 How to specify Code128 CODE C and GS1 128 CODE C Specified character string 00 x00 01 x01 09 x09 10 x0a 98 x62 or b 99 x63 or c 3 How to specify GS1 128 special characters FNCI 1 FNC3 3 K D 2 4 How to specify GS1 DataBar Expanded special characters Specified character string FNCI C 0 Chapter 4 API Reference e type Required parameter Object type String S
150. pecifies 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 GS1 128 BARCODE GS1 DATABAR OMNIDIRECTIONAL GS1 DataBar Omnidirectional BARCODE_GS1_DATABAR_TRUNCATED GS1 DataBar Truncated BARCODE_GS1_DATABAR_LIMITED GS1 DataBar Limited BARCODE_GS1_DATABAR_EXPANDED GS1 DataBar Expanded e hri Optional parameter Object type String Specifies the HRI position Constant hr HRI NONE default HRI not printed HRI ABOVE Above the barcode HRI BELOW Below the barcode HRI BOTH Both above and below the barcode e font Optional parameter Object type String Specifies the HRI font Constant ont FONT A default Font A FONT B Font B FONT C Font C FONT D Font D FONT E Font E e width Optional parameter Object type Number Specifies the width of each module in dots Specifies an integer from 2 to 6 height Optional parameter Object type Number Specifies the barcode height in dots Specifies an integer from 1 to 255 T9 80 Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type
151. processed as the primary message In Mode 2 specify the primary message in the following format MaxiCode Mode 6 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 pieces of data convertible by Code Set A GS x1d ISO country code 1 to 3 digit number GS x1d Service class code 1 to 3 digit number GS1 DataBar Stacked Convert the character string to the string in UTF 8 apply the escape sequence and then encode the string GS1 DataBar Stacked Omnidirectional Specify a 13 digit global trade item number GTIN not including an application identifier Al or a check digit 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 E DES colic iste Sia To encode each of the following characters specify two characters starting with the character FNCT 1 C 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 To specify binary data that cannot be represented by characte
152. r ar r r ror ar ar r r r ror roa r r r ror ar ar r r r ror ar ar r r r ror ar ar r r ror ar ar ar r r ror roar ar r r ror ar ar ar r r roar ar arr rar ar ar 2 Settings 4 Settings of IP address of TM printer AQ Device ID of the TM printer A Print timeout time 14 Settings of with or without layout specification in label printing of TM P OII qa un 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 E E E E E E E E E E E E E E E E E E AAA 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 E E E E E E E E E E E E E E E E E E E 4 Creates print data ePOS Print Builder Object 5 Prints ePOS Print Object 1 Action on the sample program Chapter 2 Sample Program Operating Environment The system configuration diagram for the sample programs is as below 2 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 mH m gm m m Network EEUU Printer to be controlled 192 168 192 21 s nn ABBSBBE Wireless LAN Router Terminal 192 168 192 1 192 168 192 000 TM P OII TM Printer Wireless LAN Model 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 4 Wireless LAN Router 14 TM Printer Wireless LAN Model 1 set TM P60I 4 Termi
153. r details refer to List of API functions p 49 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 script type text javascript src epos print 3 x x js gt lt script gt 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 addTextSmooth true builder addTextFont builder FONT A Create a print document builder addTextSize 3 3 builder addText Hello tWorld n builder addCut builder CUT_FEED Acquire the print document var request builder toString alert request lt script gt lt head gt lt body gt button onclick buildMessage gt Run lt button gt lt body gt lt html gt Chapter 3 Programming Guide To create a text print document 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 Font FontA A Scale x 4 horizontal and x 4 vertical I Style Bold lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt
154. r strings use the following escape xnn Control code Back slash sequences Chapter 4 API Reference e type Required parameter Object type String Specifies the 2D code type Constant type 2D Code type SYMBOL PDF417 STANDARD Standard PDF417 SYMBOL PDF417 TRUNCATED Truncated PDF417 SYMBOL GRCODE MODEL 1 QR Code Model I SYMBOL QRCODE MODEL 2 QR Code Model 2 SYMBOL 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 G81 DATABAR STACKED GST DataBar Stacked SYMBOL_GS1_DATABAR_STACKED GS1 DataBar Stacked OMNIDIRECTIONAL Omnidirectional SYMBOL_GS1_DATABAR EXPANDED STACKED GS DataBar Expanded Stacked SYMBOL_AZTECCODE_FULLRANGE Aztec Code Full Range mode SYMBOL_AZTECCODE_COMPACT Aztec Code Compact mode SYMBOL_DATAMATRIX SQUARE DataMatrix ECC200 square SYMBOL_DATAMATRIX_RECTANGLE_8 eal pe SYMBOL DATAMATRIX RECTANGLE 12 LU Re EDR SYMBOL DATAMATRIX RECTANGLE 16 EIER Er e level Optional parameter Object type String Specifies the error correction level Constant ve LEVEL 0 PDF417 error correction level 0 LEVEL 1 PDF417 error correction level 1 LEVEL 2 PDF417 error correction level 2 LEVEL 3 PDF417 error correction level 3 LE
155. rclosed event pk 137 onerror event p 131 ondraweropen event p 137 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 align property p 152 print method p 142 onreceive event p 161 open method p 144 onerror event p 164 close method p 144 onstatuschange event p 165 recover method p 145 ononline event p 167 reset method p 145 onoffline event 6 167 address property p 146 onpoweroff event p 168 enabled property p 146 oncoverok event p 168 interval property p 147 oncoveropen event p 169 status property p 147 onpaperok event p 169 timeout property p 148 onpapernearend event p 170 halftone property p 149 onpaperend event p 170 brightness property p 150 ondrawerclosed event 171 cut property p 150 ondraweropen event I 198 Appendix TM T70 Multi language model 58 mm 80 mm Interface Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 416 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 Line Font A ANK 34 characters ANK 42 characters Font B ANK 46 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 Baseline Font A At the 21st dot from the top of t
156. reshold suitable for printing text only Example To set the halftone type as error diffusion script type text javascript src epos print 3 x x js gt lt script gt script type text javascript 1 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 halftone epos HALFTONE ERROR DIFFUSION epos print canvas gt lt script gt 149 brightness property Brightness correction value 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 1 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 brightness 2 2 epos print canvas gt lt script gt 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 ep
157. ress Send the print document epos send request lt script gt lt head gt lt body gt 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 Domain Specify IP address or domain of TM printer Device ID Specifies the TM printer to be used for printing Specify device ID of TM 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 39 Reception of Print Result The print result can be received by setting a callback function using the onreceive property p 128 of the ePOS Print object The following information is obtained 4 Print result T Error code 4 Printer status Q Refer to the following program For the details about how to program a callback function in detail refer to Error handling p 41 The printer status can be obtained when communication with the printer is possible lt DOCTYPE html lt html gt lt head gt lt meta charset utf 8 gt lt title gt TITLE
158. rint 3 x x js gt lt script gt lt script type text javascript gt zu 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 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 71 addFeed method Adds a line feed to the command buffer Syntax addFeed Return value 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 1 function build
159. rinted If the print data extends beyond the print area the print result will be such that the print data has been printed incompletely 2 Use this API function by inserting it between addPageBegin p 92 and addPageEnd p 93 Syntax addPageArea x y width height Parameter ex 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 ey 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 Otherwise N the print data might not be printed completely Return value Object type ePOS Print Builder Object ePOS Builder Exception Object ype Parameter is invalid Error 94 Chapter 4 API Reference Example To specify the print area with the origin 100 50 a width of 200 dots and a height of 30 dots and print the characters ABCDE lt scr
160. rinting text o e 57 A tag for the t tI t ccelis i dds a tag for the target language se olol ting addTextFont Adds a tag for the text font setting amp 60 Text addTextSmooth Adds a tag for the text smoothing setting e e 6 addTextDouble Adds a tag for specifying the double sized eec text setting addTextSize Adds a tag for the text scale setting ee 63 addTextStyle Adds a tag for the text style setting ee 64 acddtexibosnon Adds a tag for specifying the print position olol of text addTextVPosition Ae a tag for specifying the print vertical ec position of text addFeedunit Adds a tag for paper feeding in dots e 68 p addFeedLine Adds a tag for paper feeding in lines ee 6 aper Fa addFeedPosition Adds control of label paper black mark ol 70 paper to command buffer addFeed Adds a line feed to the command buffer 72 O Available Not available 3 9 S Elo Description vE O Q o OD c D e Ia 77 Method addimage aoe a tag for a raster image to be ee Graphic printed adaLogo Adds a tag for an NV logo to be printed ee 75 B d addBarcode Adds a tag for a barcode to be printed ee 76 arcode addSymbol Adds a tag for a 2D code to be printed e e 9 adaHLine Adds a tag for a horizontal line to be e 86 adedi printed EE adavLineBegin Adds a tag for starting a vertical line e 88 adavLineEnd Adds a tag for finishing
161. rogram ePOS Print_Sample_JS_V3 x xE zip Register the sample program into the Web server Download ePOS Print_Sample_JS_V3 x xE zip Q For details refer to Contents in the package p 15 Register the program according to the following procedure 1 2 Start the Web server Explode the sample program ePOS Print Sample JS V3 x xE 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 25 26 Network Setting of TM printer Configure the TM printer network settings by the following procedure 4 Connect the TM printer to a PC via the USB cable 2 Turn on the TM printer 3 Start up EpsonNet Config 4 Double click the TM printer ss EpsonNet EPSON Config I Refresh i Configuration gt Launch Browset Filter cam Model Name MAC Address IP Address Route TM T88V 5 Click Network Basic Wireless and configure the SSID and security settings according to the networks Er Network Interface Basic Settings mod Communication Mode Infrastructure y Basic Administration 1 Wireless Mode IEEE802 11b e n al Wireless ssm some B Network Basic Wireless Channel 1 Detailed Wirele Se Automatic TCP IP EPER Ms leceive Transmission Rate utomatic
162. ror Supported Reset Supported Command Supported 224 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 addSymbol method p 81 addTextAlign method p 54 addPageBegin method p 92 adaTextLineSpace method p 54 addPageEnd method p 90 adaTextRotate method p 56 addPageArea method p v4 addText method p 57 addPageDirection method p 96 addTextLang method p 58 addPagePosition method p 98 addTextFont method p 60 addPageLine method p 100 adaTextSmooth method p 61 addPageRectangle method p 102 addTextDouble method p 62 addCut method p 104 addTextSize method p 63 addSound method p 107 addTextStyle method p 64 addLayout method p 109 addTextPosition method p 66 addRecovery method p 113 adaTextVPosition method p 67 addReset method p 114 addFeedUnit method p 68 addCommand method p 15 addFeedLine method p 69 toString method p 116 addFeedPosition method p 70 halftone property 6117 addFeed method p 12 brightness property p 118 addlmage method p force property p 119 adaLogo method p 75 message property p 120 addBarcode method p 76 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 121 onstatuschange event p 132 send method p 122 onbatterystatuschange event p 132 open method p 123 ononline event p 133 close
163. rst color Page Mode Default Area 360 dots x 831 dots WxH 384 dots x 831 dots W x H 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 Page Mode Maximum Area when two color printing is set 360 dots x 1662 dots WxH 384 dots x 1662 dots W x H 512 dots x 1662 dots WxH 360 dots x 831 dots WxH 384 dots x 831 dots WxH 512 dots x 831 dots WxH Raster Image Monochrome image Two color image Monochrome image Two color image Logo To perform two color printing change the settings of the printer using the memory switch setting utility EEE UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE39 ITF CODABAR CODE93 CODE128 2D Code PDF417 Ruled Line Not supported 203 58 mm 60 mm 80 mm Line Page Mode 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 ePOS Print Setting Item Printing Method Value Thermal 180 dpi Character Code Tables Page 0 5 16 19 204 Supported ePOS Pri
164. s gt lt script gt script type text javascript gt los 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 141 142 print method Print the images painted on HTML5 Canvas in accordance with the property settings the image In this case a security error occurs due to violation of the same origin policy of If an HTML5 Canvas image contains images downloaded from different domains you cannot print AN JavaScript Syntax A print canvas 2 print canvas cut mode 2 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 AA AS true or 1 Cuts the paper after printing false or 0 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 MODE_MONO Monochrome two tone MODE GRAYI6 Multiple tones 16 tone undefined Monochrome two tone Exception Object ye Parameter is invalid Error XMLHttpRequest is not supported Error Canvas is not supported Error Chapter 5 Canvas API Reference E
165. s a 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 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 is a registered trademark of Seiko Epson Corporation Exceed Your Vision and ESC POS are registered trademarks or trademarks of Seiko Epson Corporation Windows and Internet Explorer are either registered trademarks or trademarks of Microsoft Corporation 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 TM are either registered trademarks or trademarks of Google Inc in the Android M and Google Chrome United States and other countries Mozilla and Firefox are either registered trademarks or trademarks of Mozilla Foundation in the United States and other countries iOS is registered trademarks or trademarks of Cisco in the United States and other countries All other trademarks are the property of their respective owners and used for identification purpose only ESC POS Command System EPSON has been taking i
166. s 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 lt script gt To set the language as Korean lt script type text javascript src epos print 3 x x js script script type text javascript gt lt function buildMessage var builder new epson ePOSBuilder builder addTextLang ko script To set the language as Simplified Chinese lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 i fase lt script gt 59 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
167. server IP address editor index html 2 ePOS Print Editor appears Sr OD tres ees M P x amp ePos Print Editor x inu xdg Edit Preview API XML Print Setting Common Align Linespe Rotate Te Printer Font El Forced Transmission Ver 3 0 Import Clear ext Paper Feed Ea F3 E3 E E By Unit Byline LF Label Image 108 mage Ni Bar Code EI 173 Setting Perform the print setting and the preview setting Select the Setting tab to display the Setting screen Ge Edit Preview API XML Print 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 al Se Pr ex 2 ePOS Print Editor Setting Model Paper width Liner width Description 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 printer Specify the IP address of the 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 Mo
168. sition alignment Color Monochrome Specify 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 ee to Emy 2 es p 0 x e EPSON ePOS Print Sample X Canvas Graphics Editing Fill Settings Style Linear Gradient Color 1 gray Swap Color Color 2 white Errggbb rrggbb Rectangle Position x32 Size w 192 y64 h 192 y 256 Circle Center x 224 Radius 196 Reset Test Print Mode Monochrome Property URL http 192 168 192 168 cgi bin epos service cgi devid local printer amp timeout 10000 Brightness 1 0 v Alignment Left Color Monochrome Color 1 Y Cut Paper Halftone Monochrome Error Diffusion L Open the following URL page using the Web browser http Web server IP address canvas canvas print graph html EPSON ePOS Print Sa mple 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 Rese
169. t Registers a callback function to obtain a cover close event Object type Function O Example script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt 1 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 3 epos open gt lt script gt 134 Chapter 4 API Reference oncoveropen event Registers a callback function to obtain a cover open event Object type Function Example lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 onpaperok event Registers a callback function to obtain a paper remaining event Object type Function Q Example lt script type text javascript src epos print 3 x x js gt lt script gt lt script type text javascript gt 1 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 135 onpap
170. t 25 offset label 15 epos cut true epos print canvas gt lt script gt 160 Chapter 5 Canvas API Reference 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 161 Name Response message Object type Object Properties of the response object Parameter Mame Object ype success p 161 Print result Boolean code p 161 Error code String status p 162 Status Number battery p 162 Battery status Number e Value of success true or 1 Printing succeeded false or 0 Printing failed e Value of code EPTR_AUTOMATICAL An automatically recoverable error occurred EPTR COVER OPEN A cover open error occurred 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 DeviceNotFound 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 161 e Value of S
171. t Clears the image drawn in the Canvas In addition the settings are reset to their default values 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 237 4 Set the following and click the Print button AA AA A URL Enter the following URL http IP address of 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 Aajust the brightness Samma 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 O 238 Appendix Rendering Handwritten Images canvas print hand html Draw a handwritten image and perform a test print gt w E a Se ga SE Columns dii O C X G EPSON ePOS Print Sample x I th vr 93 Canvas Handwriting Pen 2 Thin Medium Thick T 4 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 y Ali
172. t Setting ltem Value Printing Method Impact Character Code Tables Page 0 5 16 19 228 Supported ePOS Print Builder API List Appendix ePOS Print Builder Object Page ePOS Print Builder Object Page Constructor p 53 addFeedLine method p 69 adaTextAlign method p 54 addFeed method p 72 adaTextLineSpace method p 54 addlmage method p 73 adaTextRotate method p 56 addCut method p 104 addText method p 57 adaPulse method p 105 addTextLang method p 58 addReset method p 114 addTextFont method p 60 addCommand method p 115 addTextSmooth method p 61 toString method p 116 addTextDouble method p 62 halftone property p 117 addTextSize method pm 63 brightness property p 118 addTextStyle method p 64 message property p 120 addFeedUnit method p 68 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor EB 121 onstatuschange event p 182 send method p 122 ononline event p 133 open method p 123 onoffline event p 133 close method p 124 onpoweroff event p 134 adaress property p 125 oncoverok event p 134 enabled property p 125 oncoveropen event p 135 interval property p 126 onpaperok event pi 135 status property p 126 onpapernearend event p 136 timeout property p 127 onpaperend event p 136 onreceive event p 128 ondrawerclosed event p 137 onerror event p 131 ondraweropen event p 137
173. t operation Error Example lt script type text javascript lt script type text javascript gt lt function buildMessage var builder script new epson ePOSBuilder builder addCut builder CUT FEED src epos print 3 x x js gt lt script gt Chapter 4 API Reference addPulse method Adds the drawer kick to the command buffer Sets the drawer kick Notavailable in page mode N 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 PULSE 100 100 ms PULSE 200 200 ms PULSE 300 300 ms PULSE 400 400 ms PULSE 500 500 ms undefined e 100 ms When not specified Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter is invalid Error 105 Example 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
174. t operation 123 close Disables status event operation 124 Property address URL of the printer 125 enabled Enabling disabling of status event 125 interval Printer status update interval 126 status Status 126 battery Battery status 127 timeout The connecting was timeout 127 Event onreceive Response message receipt event 128 onerror Communication error event isi onstatuschange Status change event 132 onbatterystatuschange Battery status change event 132 ononline Online event 133 onoffline Offline event 183 onpoweroff Non response event 134 oncoverok Cover close event 134 oncoveropen Cover open event 135 onpaperok Paper remaining event 135 onpapernearend Paper near end event 136 onpaperend Paper end event 136 Event ondrawerclosed Drawer close event 137 ondraweropen Drawer open event 137 onbatteryok Battery OK event 138 onbatterylow Battery low event 138 Constant ASB Status Chapter 4 API Reference 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 script type text javascript src epos print 3 x x js script script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder gt lt script gt 53 54
175. tatus Constant status ASB_NO_RESPONSE 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 Off line status from remaining battery only for applicable devices ASB_OFF_LINE ASB_COVER_OPEN Offline 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 A mechanical error occurred ASB_AUTOCUTTER_ERR An autocutter error occurred ASB_UNRECOVER_ERR An unrecoverable error occurred ASB_AUTORECOVER_ERR An automatically recoverable error occurred ASB_RECEIPT_NEAR_END No paper in roll paper near end sensor ASB_RECEIPT_END No paper in roll paper end sensor ASB_BUZZER A buzzer is on only for applicable devices ASB_WAIT_REMOVE_LABEL Waiting period for removal of label only for applicable devices ASB_NO_LABEL ASB_SPOOLER_IS_STOPPED No paper in label peeling sensor only for applicable devices 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 adopter is not connecte
176. tem error status 14 Paper layout setting d Recovery from an error 14 Reset Print Example No 012301 EnjoY F R E E C offe e L Monochrome or Grayscale Expires Mon Aug 01 2011 16 27 24 13 Operating Environment Applications environment 4 Windows Internet Explorer 9 or later Aa Mozilla Firefox 3 6 or later 4 Google Chrome 7 or later a Safari in iOSA 0 or later 1 Standard browser in Android 2 2 or later From Internet Explorer and Firefox Web pages HTTPS that are securely protected Q cannot be printed on the TM printer TM printer 1 TM printer equipped with wireless LAN interface IEEE802 11a b g n e TM T88V e TM T88IV e TM T70 e TM T7OII e TM T90 e TM L9O e TM U220 a TM P6OII 4 TM P OII with Peeler TM P80 TM P20 e The system for ePOS Print SDK for JavaScript cannot be used with the TM printer N factory settings Connect the computer and TM printer via the network and configure from the Web browser For details see Environment Settings p 24 e Unable to control other TM printer 14 Chapter 1 Overview Provided Article MESSI NE gU EE NL C D m epos print 3 x x js This is the function execution library ePOS Print Sample JS V3 x xE zip This is a sample program file ePOS Print SDK JS en revx pdf This Document Other Manual d ePOS Print SDK for JavaScript User s Manual This Document d ePOS Print XML User s Manual 1 UB
177. text var canvas document getElementById myCanvas var context canvas getContext 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 epos cut true epos print canvas Print result receipt callback function lt script gt lt head gt lt body gt 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 responseln
178. text javascript gt lt function buildMessage var builder new epson ePOSBuilder var doc builder addCommand ABC x44 x45 x0a gt lt script gt 115 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 script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder var doc builder toString script 116 Chapter 4 API Reference halftone property Halftone processing method 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 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 script lt script type text javascript gt 1 function buildMessage var builder new epson ePOSBuilder var canvas document getElementById canvas if canvas getConte
179. the reference point being its Syntax addBarcode data type hri font width height Parameter e data Required parameter Object type String Specifies the barcode data as a string Barcode type When an 11 digit number is specified a check digit is automatically added UPC A 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 Specify O 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 UPC E 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 EAN13 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 When a 7 digit number is specified a check digit is auto matically added When an 8 digit number is specified the 8th digit is pro cessed as a check digit but the check digit is not vali dated When the first character is the character is processed as CODE39 the start character In other cases a start character is automatically added JAN13 JAN8
180. thod p 98 addTextFont method p 60 addPageLine method p 100 adaTextSmooth method p 61 addPageRectangle method p 102 addTextDouble method p 62 addCut method p 104 addTextSize method p 63 addSound method p 107 addTextStyle method p 64 addLayout method p 109 addTextPosition method p 66 addRecovery method p 113 adaTextVPosition method p 67 addReset method p 114 addFeedUnit method p 68 addCommand method p 15 addFeedLine method p 69 toString method p 116 addFeedPosition method p 70 halftone property 6117 addFeed method p 12 brightness property p 118 addlmage method p force property p 119 adaLogo method p 75 message property p 120 addBarcode method p 76 Supported ePOS Print API List ePOS Print Object Page ePOS Print Object Page Constructor p 121 onstatuschange event p 132 send method p 122 onbatterystatuschange event p 132 open method p 123 ononline event p 133 close method p 124 onoffline event p 133 adaress property p 125 onpoweroff event p 134 enabled property p 125 oncoverok event p 134 interval property p 126 oncoveropen event p 135 221 ePOS Print Object Page ePOS Print Object Page status property p 126 onpaperok event pe 135 battery property 127 onpapernearend event p 136 timeout property lor onpaperend event p 136 onreceive event p 128 onbatteryok event p 138 onerror event p 131 onbatterylow event p 138 Supported ePOS Print Canvas API List
181. to Printer specifications p 179 110 Chapter 4 API Reference Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Object type Parameter is invalid Error 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 lt with Black Mark gt sf sf Las al sb CH 4 ud ER NR Top postens c Cure Receipt sa peo cune oed ERR EN bc sf sf jen Cu HW i p Top position i Top position Label se sa Bottom edge se sa Bottom edge of print area sd Cut of print area y Standard ejecta Y h So NE EEEE E sc Bottom edge sc of label 111 Example To set 58 mm receipt 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 RECEIPT 580 H script To set 58 mm receipt with black mark lt script type text javascript src epos print 3 x x js script script type text javascript gt lt
182. ts 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 416 dots x 1662 dots W x H 576 dots x 1662 dots W x H Page Mode Maximum Area 416 dots x 1662 dots W x H 576 dots x 1662 dots W x H Raster image Monochrome image Gray scale image Logo Monochrome image Gray scale image Barcode UPC A UPC E EAN13 JAN13 EAN8 JAN8 CODE339 ITF CODABAR CODE93 CODE128 GS1 128 GS1 DataBar Omnidirectional GS1 DataBar Truncated GS1 DataBar Limited GS1 DataBar Expanded 2D Code PDF417 QR Code MaxiCode GS1 DataBar Stacked GS1 DataBar Stacked Omnidirectional GS1 DataBar Expanded Stacked Ruled Line Not supported Page Mode Line Not supported Rectangle Paper Cut Cut Feed cut Specification of the paper feed Not t position for labels black mark paper olsuppatics Drawer Kick Out Supported Buzzer Optional Pattern A Pattern E Error No paper Stop 191 58 mm 80 mm Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported ePOS Print Setting Item Value Printing Method Thermal 203 dpi Character Code Tables Page 0 5 16 19 20 21 26 30 31 11 15 32 53 192 Supported ePOS Print Build
183. ure nCode res code nStatus n Obtain the printer status var asb res status if asb amp epos ASB NO RESPONSE msg No printer responseln if asb amp epos ASB PRINT SUCCESS msg Print completeln if asb amp epos ASB_DRAWER_KICK msg Status of the drawer kick number 3 connector pin H n if asb amp epos ASB_OFF_LINE msg Offline status n if asb amp epos ASB_COVER_OPEN msg Cover is open n if asb amp epos ASB_PAPER_FEED msg Paper feed switch is feeding paper n if asb amp epos ASB_WAIT_ON_LINE msg Waiting for online recovery n if asb amp epos ASB_PANEL_SWITCH msg Panel switch is ON n if asb amp epos ASB_MECHANICAL_ERR msg Mechanical error generated n if asb amp epos ASB_AUTOCUTTER_ERR msg Auto cutter error generated n ae if asb amp 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 detector n if asb amp epos ASB BUZZER msg Sounding the buzzer limited model Nn if asb amp epos ASB SPOOLER IS STO
184. vent p 135 status property p 126 onpaperok event p 135 217 ePOS Print Object Page ePOS Print Object Page battery property p 127 onpapernearend event p 136 timeout property y onpaperend event p 136 onreceive event p 128 onbatteryok event p 138 onerror event p 131 onbatterylow event p 138 Supported ePOS Print Canvas API List ePOS Print Canvas API Object Page ePOS Print Canvas API Object Page Constructor p 141 feed property p 154 print method p 142 onreceive event p T l open method p 144 onerror event p 164 close method p 144 onstatuschange event p 165 recover method p 145 onbatterystatuschange event p 165 reset method p 145 onbatteryok event p 166 address property p 146 onbatterylow event p 166 enabled property p 146 ononline event p 167 interval property p 147 onoffline event p 167 status property p 147 onpoweroff event p 168 battery property p 148 oncoverok event p 168 timeout property p 148 oncoveropen event p 169 halftone property p 149 onpaperok event p 169 brightness property p 150 onpapernearend event p 170 cut property p 150 onpaperend event p 170 align property be 152 218 Appendix TM P60Il with Peeler Receipt 58 mm Receipt 60 mm 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
185. vvrnnnnrnnvnnrnnnnnnnnvnnnnnnnnnnvnnnnrsrnnnenennnn 139 window epson CanvasPrint Components s e sssssrsrsstkrrsstttnrrtattttrat tutn rononn nn nro ron nr rn rr nnn 139 E ePOS Print Canvas API Object rrevvrnnnrrnnnvnnnnrnrnnnvnnnnennrnnnvnnnnnnsnnnennnnnsvsnnnnnnnersnnnnennnnen 141 CONSIMUICIOR E ERE 141 e MIeIEauziplele a T 142 open MeMo cct e dere en aera s e FO CT EGRE Gd WE OR RO e nda 144 close method sacs e rope er eco Di d era elder i e e b ie e eas 144 recover method eite et c eia estre ivelit meee AR PA Ten 145 reser rnelliod i EE te m o void S e pdf red de i e p hrec bn e peris 145 address DIODE axes ate tage dm oben idc eme ue eee d end 146 enabled proper n et f aam td ed eeu ih e Go pen e ect ree ra 146 interval property sz oet etti e adicere a n ae oce e e e eret a ET EP P LR Le 147 sus POPE s EDEN 147 Date popen secos dep He REI Ne 148 TIMEOUT property stas esu A e fru d e n Hero new o e enn 148 halttone propetty aia Re rie ies ae teen rn i o ero Dee ue E bk enin De eda LE PT 149 brightness property siastica et eee Reate e e o a REOR EE RE p vena t Hd e s 150 CUI RIOD I 150 ModE POPE nma e EEE Pee ce tod ents a a Ert ee cbe d 151 GION POPE ease n eb eS eee 152 Color properly AE t ene a LEON ERO HOHER CORERE DO CA ER ELE RE EP ELLE ERE tin EO Men n 153 feed POP e EUER 154 paper POPE erre a e oL eL MM LIN 155 layout DIODES Vistek ss ttem aided OO te do en eR A ee AER As G
186. xample To print Canvas ID myCanvas lt script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 j gt lt script gt 143 open method Enables status event operation 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 script type text javascript src epos print 3 x x js script script type text javascript gt 1 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 F function startMonitor epos open function stopMonitor epos close gt lt script gt close method Disables status event operation Syntax close Example script type text javascript src epos print 3 x x js gt lt script gt script type text javascript gt 1 var address http 192 168 192 16
187. xt var context canvas getContext 2d builder halftone epos HALFTONE ERROR DIFFUSION builder addImage context 0 0 canvas width canvas height gt lt script gt 117 brightness property Brightness correction value 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 118 Chapter 4 API Reference force property This is the forced transmission mode Object type Boolean Description If you enable forced transmission mode print commands are forcibly sent to the printer online The following functions are enabled in forced transmission mode Drawer kick out addPulse method p 105 Stopping the buzzer addSound method p 107 Recovery from errors that can be recovered from addRecovery method p 113 Reset addReset method p 114 Sending commands in real time addCommand method p 115
188. xt World n gt lt script gt 57 addTextLang method Adds the language setting to the command buffer Syntax addTextLang lang Parameter lang Required parameter Object type String Specifies the target language en default English ANK de German ANK fr French ANK it Italian ANK es Spanish ANK Japanese JE International character set changes to Japan TM Japanese JaJp International character set changes to Japan ko Korean International character set changes to Korean T Korean International character set changes to Korean Se OS Chinese International character set changes to China a Simplified Chinese International character set changes to China zh hant Traditional Chinese Zh tw Traditional Chinese Language code besides above English ANK Characters not installed in a printer cannot be printed printer A S For printable character code refer to the Technical Reference Guide of your Depending on language specification a part of characters is printed as follows Characters U 0024 Characters U 005C Japanese Korean X Simplified Chinese K o Traditional Chinese W Chapter 4 API Reference Return value Return value Object type ePOS Print Builder Object ePOS Builder Exception Exception Object type Parameter i
189. y p 148 oncoveropen event p 169 halftone property p 149 onpaperok event p 169 brightness property p 150 onpapernearend event p 170 cut property p 150 onpaperend event p 170 mode property p 151 ondrawerclosed event p 171 align property p 152 ondraweropen event p 171 color property p 153 210 Appendix TM P20 58 mm Interface Wireless LAN Resolution 203 dpi x 203 dpi W x H Print Width 384 dots Font Font A Font B Font C Font D Font E 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 32 characters Font B ANK 42 characters Font C ANK 42 characters Font D ANK 38 characters Font E ANK 48 characters Character Size Font A ANK 12 dots x 24 dots W x H Font B ANK 9 dots x 24 dots W x H Font C ANK 9 dots x 17 dots W x H Font D ANK 10 dots x 24 dots W x H Font E ANK 8 dots x 16 dots W x H zm TOUS At the 21st dot from the top of the character Font B At the 21st dot from the top of the character Font C At the 16th dot from the top of the character Font D At the 21st dot from the top of the character Font E At the 15th dot from the top of the character Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area Page Mode Maximum Area 384 dots x 2400 dots W x H 384 dots x 2400 dots W x H
190. zontal print start position of text to the command buffer Syntax addTextPosition x Parameter ex 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 vpe Parameter is invalid 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 script Chapter 4 API Reference addTextVPosition method Adas the vertical print start position of text to the command buffer 2 Use this API function by inserting it between addPageBegin to addPageEnd Syntax addTextVPosition y Parameter ey 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 lt script type text javascript src epos print 3 x x js script script type text javas

Download Pdf Manuals

image

Related Search

Related Contents

Key Features  TAKEMOTO TFL-B 0 D40    Whirlpool RF212PXSQ4 User's Manual  Series 800-H - EngineerSupply  MANUEL D`UTILISATION Hygrothermomètre, Modèle RH10  Minka Lavery 4173-84 Instructions / Assembly  UC20 Windows USB Driver User Guide  LA LETTRE AUX PARENTS D`ELEVES  Samsung WD70J5413AW/SC 用户手册  

Copyright © All rights reserved.
Failed to retrieve file