PrinterCanvas class abstract

Implementers

Constructors

PrinterCanvas()

Properties

config PrinterConfig?
getter/setter pair
defaultConfig PrinterConfig?
no setter
hashCode int
The hash code for this object.
no setterinherited
pageSize PrinterSize?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addFont(PrinterFontType fontType) → dynamic
calcTextLeft(String text, int width, AlignEnum fontAlign, PrinterTextStyle style) int
计算文字左侧位置
createChild(PrinterConfig config) PrinterCanvas
创建子Canvas
drawBarCode(String context, PrinterOffset offset, int height, [int lineWidth = 1]) → dynamic
打印二维码
drawBarCodeForSize(String? context, PrinterOffset offset, PrinterSize size, [int lineWidth = 1, AlignEnum align = AlignEnum.center]) → dynamic
打印二维码
drawBitmap(PrinterOffset offset, PrinterSize size, List<List<bool>> bytes) → dynamic
打印图片
drawLine(PrinterOffset offset, PrinterSize size) → dynamic
打印线条
drawQRCode(String context, PrinterOffset offset, PrinterSize size, ECCLevelEnum ecc) → dynamic
打印二维码
drawQRCodeBitmap(String context, PrinterOffset offset, PrinterSize size, ECCLevelEnum ecc) → dynamic
drawText(String? text, PrinterOffset offset, PrinterSize size, PrinterTextStyle textStyle) → dynamic
打印文字
end() → dynamic
结束
estimateLength(String text, int contentWidth, PrinterTextStyle style) int
获取text限制在contentWidth后的长度
getBarCodeWidth(String context, int lineWidth) int
计算条码宽度
getFontAsciiWidth(PrinterTextStyle style) int
获取字体宽度 Ascii
getFontHeight(PrinterTextStyle style) int
获取字体高度
getFontName(PrinterTextStyle style) String
获取字体名称
getFontWidth(PrinterTextStyle style) int
获取字体宽度
getTextLineHeight(PrinterTextStyle style) int
getTextWidth(String text, PrinterTextStyle style) int
获取文字宽度
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → dynamic
重置
splitLine(String str, int contentWidth, PrinterTextStyle style) List<String>
文字自动换行裁剪
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited