Let us say you want to create a ticket layout that looks like this:
Figure 26. Ticket layout Example:.
Here is what the ticket layout string would look like in the TICKET section of the CWT configuration file:
Example:
<TICKET ticketId="0" height="300" width ="380" orientation ="Landscape" layout= '@y20
@fb@f36@v33@cr@lf@f26@fb@v60"Parking time expires:"@cr@lf@dy10@f72
@fb@lu @v111 @v15 @f36@v10 @v13@lf@cr@dy8@f72@v86@cr@f26@dy8
@v35 @v47@x60VAT: @v44@cr@lfPaid amount: @v0@cr@lf@v80 @v82
@x60Ticket No @v34'>
<margin left="50" right="0" top="0" bottom="0"/>
</TICKET>
Some general printing settings are made in the TICKET section of the CWT configuration file.
•The Ticket ID
•Height and width of the ticket specified in millimetres (mm).
•Which orientation the ticket is printed, Portrait or Landscape.
The margin for the ticket is set here. General printer settings are set elsewhere in the CWT configuration file.
The layout string itself is defined following “layout = “. This section in the manual focuses on the layout string.
Each code in the layout string part of the Example: is explained in the table below:
String code |
Explanation |
---|---|
@y20 |
Set the y position to 20. The y position refers to a coordinate system where x is the horizontal axis and y is the vertical axis. To set the y position to 20 means that you move the printing head vertically 20 steps. |
@fb |
Change font style to Bold |
@f36 |
Change font size to 36 points |
@v33 |
Print the Machine ID, in this case "CWT1". |
@cr |
Make a carriage return, that is move the current point of insertion to the beginning of the line. The line size is determined from the last line written. |
@lf |
Make a line feed. I.e. move the current point of insertion down one line. The line size is determined from the last line written. |
@f26 |
Change font size to 26 points |
@fb |
Change font style to Bold |
@v60"Parking time expires:" |
Print the text "Parking time expires:" using the current font size and style. |
@cr |
Carriage return. |
@lf |
Make a Line Feed. |
@dy10 |
Set y to current y + delta y 10 positions. |
@f72 |
Change font size to 72 points |
@fb |
Change font style to Bold |
@lu |
Switch to LETTER UPPER CASE |
@v111 |
Print the expiry time formatted as Weekday long, that is Thursday and not Thurs. |
@v15 |
Print the expiry time formatted as Day DD, like 15. |
@f36 |
Change font size to 36 points |
@v10 |
Print the expiry time formatted as Month short |
@v13 |
Print the expiry time formatted as Year YY, lke 07. |
@lf |
Make a line feed |
@cr |
Make a carriage return. |
@dy8 |
Set y to current y + delta y 8 positions. |
@f72 |
Change font size to 72 points |
@v86 |
Print the expiry time formatted as Short time format |
@cr |
Make a carriage return |
@f26 |
Change font size to 26 points |
@dy8 |
Set y to current y + delta y 8 positions. |
@v35 |
Print card marking (C) when the article has been paid by card. |
@v47 |
Chip card string. The number of the card with the first digits replaced with asterisks. |
@x60VAT: |
Set x position to 60 and print "VAT: " |
@v44 |
Print the VAT amount |
@cr |
Make a carriage return. |
@lfPaid amount: |
Make a line feed and then print "Paid amount: " |
@v0 |
Print amount paid |
@cr |
Make a carriage return. |
@lf |
Make a line Feed |
@v80 |
Print the current time formatted with Short date format |
@v82 |
Print the current time formatted with Short time format |
@x60Ticket No |
Set x position to 60 and print "Ticket No " |
@v34 |
Print the purchase number |