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:
Unicode Support
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.
Where a device does support Unicode directly, the Star markup renderer will automatically handle the necessary conversion.
Devices with Unicode support:
- Star TSP654II
- Star mC-Print2
- Star mC-Print3
- Star TSP100IV
- Star TSP100IV SK
- Star mC-Label3
File Format
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.
Note
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.
Star Document Markup Designer
https://star-document-markup-designer.smcs.site/
Star Document Markup Designer is provided as an editor for creating the text data of Star Document Markup format. The layout of the print data can be edited intuitively, and the preview of the print data can be checked simply. Please use this tool as a reference when you want to think about the layout of print data or check the each tag functions of Star Document Markup.
Note
- The print result of the actual printer may differ from the preview image. Please check the printing results on the actual device for final adjustments.
- The generated data by Star Document Markup Designer is the text data of Star Document Markup format. For information on how to convert the text of Star Document Markup format to printer device commands, please refer to CPUtil or .NET API section.
- For details on each tags of Star Document Markup, please refer to Markup Commands section of this page.