| Public Constructors |
|---|
CombBitmap() |
| Public Methods | |
|---|---|
addBitmap(bitmap: Bitmap) |
add a bitmap (Content) to the CombBitmap |
removeAll() |
remove all bitmap (content) from the CombBitmap. |
getCombBitmap() |
return all the contents of CombBitmap. |
setMaxHeight(height: Int) |
set the max height. |
<aside>
💡 Generating Bitmaps (contents) to be added to the CombBitmap. Bitmap Icons can be added directly to the CombBitmap while texts, gaps lines, Logos, Asterisks and Headers can be added using the GenerateBitmap static class.
</aside>
| Methods | |
|---|---|
| str2Bitmap(content: String, textSize: Int, align : AlignEnum, bold: Boolean, dispInvert: Boolean) | Adds a single text to be printed. |
| str2Bitmap(content: String, textSize: Int, align : AlignEnum, bold: Boolean, append: Char) | Adds a single text to be printed. |
| str2Bitmap(leftContent: String, rightContent: String, textSize: Int, bold: Boolean, dispInvert: Boolean) | Adds two texts to be printed on a row, with alignments to the left and right respectively. |
| str2Bitmap(leftContent: String, centerContent: String, rightContent: String, textSize: Int, bold: Boolean, dispInvert: Boolean) | Adds three texts to be printed on a row, with alignments to the left, centre and right respectively. |
| str2Bitmap(leftContent: String, centerContent: String, rightContent: String, positionPercent: Float, textSize: Int, bold: Boolean, dispInvert: Boolean) | Add three texts to be printed on a row, with alignment to the left, centre, and right respectively. |
| generateLine(thickness: Int) | Adds a horizontal line using the specified thickness. |
| generateGap(height: Int) | Adds a gap using the specified height. |
| scaleBitmap(bitmap: Bitmap, xScale: Float, yScale: Float) | It adjusts the size of the bitmap width and height. |
| formatBitmap(bitmap: Bitmap, align: AlignEnum) | Used to apply formatting to Bitmaps, e.g formatting a Barcode, or QrCode |
| formatBitmap(leftBitmap: Bitmap, rightBitmap: Bitmap) | Adds the leftBitmap and rightBitmap to the left and right respectively. |
Defines how the bitmap(content) should be aligned horizontally.
| Enum Values | |
|---|---|
*LEFT* |
Align the bitmap to the left edge of the receipt. |
*CENTER* |
Align the bitmap to the center of the receipt. |
*RIGHT* |
Align the bitmap to the right edge of the receipt. |
val combBitmap = CombBitmap() // Instantiate a CombBitmap
// Print two text, one aligned to the left and other to the right.
combBitmap.addBitmap(GenerateBitmap.str2Bitmap("Terminal ID:", "123456", 26, true, false))
// // Print three text, with alignment left, center, right respectively.
combBitmap.addBitmap(GenerateBitmap.str2Bitmap("Status", "Items", "Cost", 23, true, false))
// print row gap
combBitmap.addBitmap(GenerateBitmap.generateGap(60))
// Add a logo
combBitmap.addBitmap(
GenerateBitmap.formatBitmap(bitmap,GenerateBitmap.AlignEnum.CENTER)
)
// Add a line separator
combBitmap.addBitmap(GenerateBitmap.generateLine(20))
// Print asterisk separator
combBitmap.addBitmap(
GenerateBitmap.str2Bitmap(
"*************************************",
textSize,
GenerateBitmap.AlignEnum.CENTER,
true,
false
)
)
<aside> 💡 See PrinterHandler for more
</aside>