Star Document Markup
Stars StarMicronics.CloudPRNT-Utility API package and therefore servers and tools based on it, such as cputil can support the Star Document Markup Language. A simple, easy to use markup language intended to provide the features typically required for Point Of Sale printing.
Using the document markup system provides a balance between full bit-image based printing, and plain text output, while being easier to use that direct device commands, and far more adaptable to different output devices, such as print width.
Star Markup is easy to read, for example:
[align: centre][font: a]\ [image: url https://star-emea.com/wp-content/uploads/2015/01/logo.jpg; width 60%; min-width 48mm]\ [magnify: width 2; height 1] This is a Star Markup Document! [magnify: width 3; height 2]Columns[magnify] [align: left]\ [column: left: Item 1; right: $10.00] [column: left: Item 2; right: $9.95] [column: left: Item 3; right: $103.50] [align: centre]\ [barcode: type code39; data 123456789012; height 15mm; module 0; hri] [align]\ Thank you for trying the new Star Document Markup Language\ we hope you will find it useful. Please let us know! [cut: feed; partial]
This will generate the following output on Star 58mm (2 inch), 80mm (3 inch) and 112mm (4 inch) printers:
Star Markup language avoids difficulties of limited 8-bit text encodings by being entirely Unicode based. Input data should be from a Unicode compatible data file or strings.
Star TSP654II, mC-Print2 and mC-Print3 devices have native support for Unicode. Where a device does support Unicode directly, the Star markup renderer will automatically handle the necessary conversion.
Markup source files are plain text files encoded as UTF-8, UTF-16 or plain Ascii data.
When opening a document, initially the start of the file will be checked for a Unicode BOM (Byte Order Mark) in order to recognise that the file contains UTF-16 (Big Endian or Little Endian encoded) ot UTF-8 data. If no known BOM if found, then the file will be treated as a UTF-8 file, unless it contains code points that are not UTF-8 valid, in which case it will be opened finally as plain 7-bit Ascii.
In addition, the extension of the text file written in the Star document markup format should be ".stm". The cputil executable and also .NET API for StarMicronics.CloudPRNT-Utility packages recognizes the Star document markup format by checking the file name extension. If the extension is ".txt", it will be recognized as a plain text file and will not be command parsed as the Star document markup.
True 7-bit Ascii data is 100% compatible with the UTF-8 encoding scheme. Therefore the fallback method of using an Ascii encocing to read the input file means that the source data is really not Ascii encoded and there is likely to be some degree of information loss. We strongly recommend that markup input files are always encoded as UTF-8 or UTF-16.