PRINTING TEMPLATE TAGS

 [=FF('{TICKET TOTAL}','#,##0.00')] We use Template Tags in our Printing for the Bill, Receipts or Kitchen. Here are the explanation for those:

GENERAL
<F>

Fill: Fill the entire space of the Paper.

<F>- creates a line with - chars or <F>= creates a line with = chars.

<T>

Title:

When used it will format line as a title.

<EB>

(Enable Bold) Prints everything Bold until <DB> command

<DB>

(Disable Bold) Ends <EB> command

<Jxy>

(Justified) Justifies a line from pipe char. <J00>Total:|0.00 separates line from pipe (|) char.

 

It aligns Total: part left and 0.00 part right.

 

When used on a ESC/POS compatible ticket printer numeric parts sets font size.

 

First number sets font height and second number sets font width. For example <J10> sets font height to 1 and font width to 0.

<Cxy>

(Center) Same as <J00> but this command centers text.

<Lxy>

(Left) Same as <J00> but this one left aligns text.

<Rxy>

(Right) Same as <J00> but this one right aligns text.

<Jxy:n>

<Jxy:n>(Justify Wide) Same as <J> tag but if you're using wide char languages such as Chinese you can define char length here. For example <J00:2> means characters are 2 characters wide.

CUSTOM COMMANDS
<XCT> (Execute) Useful to send escape commands to printers or data to port printers. For example <XCT>27,112,0,25,250 to send open drawer command to printer.
<BEEP> (Beep Sound) If ticket printer supports printer will beep on this command. Generally used at the end of ticket template to inform user about something printed. Generally useful on kitchen printers.
<Bxy> (Custom Beep)
x: Beep Count
y: Beep Duration. <B22> beeps two times.
<CUT> Sends paper cut command to printer.
<BMP> Prints Bitmap file. <BMP>C:\logo.bmp.
<BAR>

Prints bar code in code 128 format.

 <BAR13> Prints Ean13 format

<QR>

Prints QR Code. <QR>ABCDEFG

POSITIONING

<el>

<ec>

<er>

These tags are useful to position bitmaps. For example after <ec> tag everything (including logos & bitmaps) prints center aligned. To disable it you can change alignment with <el> or <er> tag.

For positioning more precisely you can use space characters. For example <QR> 12313 tag has two spaces between tag and code. That means bitmap will slide right by two pixels. It works with <BAR>, <QR> and <BMP> tags.
EXPRESSIONS

Printer Templates supports custom expressions to make some simple calculations.

Syntax: [=<expression>]
For example: [=2+3] expression prints 5.

You can use current printer template tags to make calculations based on ticket values.

[={TICKET TOTAL}*0.1] 

Prints %10 of the ticket total.

Numeric tags such as {TICKET TOTAL} prints formatted numbers such as 1,523.00. To be able to use these numbers safely in expressions we need to convert them to numbers by stripping thousand separators and correcting decimal separator. To be able to do this we can use (ToNumber) TN function. So our expression becomes [=TN('{TICKET TOTAL}')*0.1]

These are the available functions:

F

Format Function

[=F(<number>,<format>)]

FD

Format Date

[=FD(<date>,<format>)].

ADD

Add Days to date

[=ADD(<date>,<days>].

[=FD(ADD('{TICKET DATE}',1),'dd/MM/yyyy')]
Adds 1 day to date value and prints with dd/mm/yyyy format.

If you want to Print any Decimal with two digits, you have to use the following tags

 [=FF('{TICKET TOTAL}','#,##0.00')]

For EPSON UM 220, the thermal tags are not working. We need to use the following tags to do it 

<XCT>27,33,16 = Increase height 
<XCT>27,33,0 = Back to Normal
<XCT>27,114,1 = Change to color 2 (in my case printing in red color)
<XCT>27,114,0 = Change to color 1 (black)
<XCT>27,69,1 = EMPHASIS ON
<XCT>27,69,0 = EMPHASIS OFF

The Template should like this one below

 

 


Revision #4
Created Thu, Feb 16, 2017 1:18 PM by HM
Updated Mon, Jul 2, 2018 5:53 AM by HM