Transcript
Chapter 3
Programming Guide
Programming Guide This chapter describes how to write programs in the application development using ePOS-Print. ePOS-Print API (p. 33) 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 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
3
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) ❏ To create a text print document: (p.37) ❏ To create a graphic print document: (p.37) ❏ To create 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).
34
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-x.x.x.js."
Preparation To use the ePOS-Print API, place epos-print-x.x.x.js on the Web server.
Embedding into Web pages Embed the script into the Web page by using the HTML
3
. .