User Tools

Site Tools


printingformats

Printing Formats

There are two printing mode options: Pre-formatted, and Tagged. Both options support the use of tags. See Tag Format for more information

Tagged Mode

In Tagged mode, the string you provided will be parsed and printed.

Here is an example a receipt data string using Tagged mode.

{
   "mode":"tagged",
   "comments":"<right>Add beef to potato strips. I will come soon.</right>"
}

Parameters:

Name Type Description
mode String Must be “tagged”
Comments” String Whatever you provide here will be parsed and printed

And the printout would look like this:

Pre-formatted mode

In Pre-formatted mode, the receipt will be printed using our template with the title, the name/quantity/price for each receipt item, the comment, and other miscellaneous information provided by you.

Here is an example of a receipt data string using Pre-formatted mode.

{
   “mode”:”receipt”
   "title":"Cool Title",
   "ticketItems":[
      { "id":79, 
        "name":"Steamed Rice", 
        "portion":"big", 
        "quantity":1, 
        "price":"2.00", 
        "properties":[
           {"id":2, "name":"cool property", "quantity":2, "price":"1.23"},
           {"id":5, "name":"another cool property", "quantity":1, "price":"1.24"},
        ]
      },
      { "id":1337, 
        "name":"NZT-48",
        "quantity":5, 
        "price":"9999.99"
      }
   ],
   "subtotal":"10.12",
   "tax":"1.23",
   "serviceCharge": "5.00",
   "discount": "1.00",
   "total": "5.00",
   "name": "Some customer",
   "phone": "N/A",
   "email": "N/A",
   "comments": "Extra cheese",
   "creationTime": 12345,
   "lineWidth": 500,
   "barcode": "1a2b3c4d5e6",
   "hideBarcode": "true"
}

Parameters:

Name Type Description
mode String Must be “receipt”
title String Title of this receipt
items JSON Array An array of items. Each item is an object with nullable fields illustrated as above, The properties field (for each item) can be null, but can also contain a list of properties attached to the item, as illustrated above
subtotal Double Subtotal price of this order. Can be arbitrary floating point number.
tax Double Tax charge of this order. Can be arbitrary floating point number
serviceCharge Double Service charge of this order. Can be arbitrary floating point number.
total Double Total price of this order. Can be arbitrary floating point number.
name String Name of the customer. You can write whatever you want here
phone String You can write whatever you want here
email String You can write whatever you want here
comments String You can write whatever you want here
creationTime Long Unix Timestamp
lineWidth Integer Optional. Define the printable number of pixels per line for the printer.
barcode String Optional. Print a barcode that identifies the order.
hideBarcode Boolean If set to true, barcode will not be printed even it is already set.

And the printout would look like this:

printingformats.txt · Last modified: 2017/07/14 11:01 (external edit)