I need to create templates for the K3052D-000 Thermal Printer (http://micropribor.com.ua/upload/catalog/pdf/d-f10041-r100_engp1.pdf). I'd like to use only small subset of printer features:
1. cp1251 codepage only
2. Text formatting: bold, underline, inverse, also probably double width/double height. Alignment is always left. Only one monospace font.
3. Images: 1-bit black-and-white images (TIFF or PNG or BMP), width up to 576px, height is divisible by 24 (command 22 "Bit Image Mode Set" of the printer, mode=0x21). If image height is not divisible by 24, image should be padded. Image is always separated from text with a new line.
4. Paper cuts: full (command 39) and partial (command 40). Would be displayed in the StyledDocument as images: ---------- and ----- -----. These images are always placed after a new line.
5. Template substitution strings. They would be like %SOME_NAME% within binary format (with %% standing for %) and like images with gray background and text "SOME_NAME" within the StyledDocument. These images can be interleaved with the text (no newline before/after image).
You should create a utility Java class that converts between these formats. At first I need StyledDocument -> binary conversion only. Note that I can do it by myself, I just want to save some time.
If you need samples of printer binary documents, or you want to test your template with the printer, please feel free to ask for it.