TbPrinter class

Constructors

TbPrinter({TbPrinterInfo? printerInfo})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

barcode(String content, {int x = 0, int y = 0, BarcodeType type = BarcodeType.Bc_128, int height = 40, HumanReadableAlignment humanReadable = HumanReadableAlignment.Center, TbRotation rotation = TbRotation.None, int narrowBarRatio = 2, int wideBarRatio = 2}) Future<bool>
Defines a barcode. @param content Barcode content. @param x Starting point in the x direction defined in dots. @param y Starting point in the y direction defined in dots. @param type Type of barcode to make. @param humanReadable Alingment of the human readable text. @param rotation degrees of rotation. @param narrowBarRatio narrow bar ratio. @param wideBarRatio wide bar ratio.
clearBuffer() Future<bool>
Clears the printer image buffer.
downloadBmp(String filePath) Future<bool>
Downloads a BMP File to the printer.
downloadBmpAsset(String assetKey) Future<bool>
Downloads the BMP file from the Flutter assets into the printer under the specified file name,
downloadImage(Image image, {int x = 0, int y = 0, double scale = 1, int printerDpi = 203}) Future<bool>
Converts an image to gray scanle and sends it to the printer?
downloadImageAsset(String assetKey, {int x = 0, int y = 0, double scale = 1, int printerDpi = 203}) Future<bool>
Downloads the image from the Flutter assets into the printer under the specified file name,
downloadPcx(String filePath) Future<bool>
Downloads a PCX file to the printer.
downloadPcxAsset(String assetKey) Future<bool>
Downloads the BMP file from the Flutter assets into the printer under the specified file name,
endCommunication({int timeoutMillis = 1000}) Future<bool>
Close the communication to the printer. @param timeout in milliseconds. returns true on success, false on failure
formFeed() Future<bool>
Skip to next of of the form
getBLEPrinters({int timeout = 5000}) Future<List<BLEPrinter>>
Discover printers which are connectable via BLE. Available on Android 5.0 or later.
getBluetoothPrinters(List<String> modelName) Future<List<BluetoothPrinter>>
Returns the paried printers matching the model name specified.
noBackFeed() Future<bool>
Clears the printer image buffer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printerFont(String content, {int x = 0, int y = 0, TbFontSize size = TbFontSize.MonoType, TbRotation rotation = TbRotation.None, int xMultiplication = 10, int yMultiplication = 10}) Future<bool>
Defines a font data string. @param x x-coordinate of the text in dots @param y y-coordinate of the text in dots. @param size predefined font size to use @param rotation rotation of the text. @param xMultiplication horizontal multiplication ranged 1~10 @param yMultiplication vertical multiplication ranged 1~10
printerStatus({int delayMillis = 1000}) Future<TbPrinterStatus>
Returns the status of the printer.
printLabel({int quantity = 1, int copy = 1}) Future<bool>
Prints the configure label.
sendCommand(String message) Future<bool>
Sends the given commend to the printer. @param message command to send.
sendCommandBin(Uint8List data) Future<bool>
Sends the given commend to the printer. @param message command to send.
sendTbCommand(ITbCommand command) Future<bool>
Sends a command to the printer.
setPrinterInfo(TbPrinterInfo printerInfo) Future<bool>
Sets the printer info for this printer. @param printerInfo TbPrinterInfo with some initial information about the printer.
setup({int width = 50, int height = 50, double speed = 1, int density = 15, TbSensor sensor = TbSensor.GAP, int sensorDistance = 0, int sensorOffset = 0}) Future<bool>
Set up the label width, label height, print speed, print density, media sensor type, gap/black mark vertical distance, gap/black mark shift distance. @param width Width of the label in mm @param height Height of the label in mm @param speed Print Speed in inches/second 1.0 : 1.0 inch/second 1.5: 1.5 inches/second 2.0: 2.0 inches/second 3.0: 3.0 inches/second 4.0: 4.0 inches/second 6.0: 6.0 inches/second 8.0: 8.0 inches/second 10.0: 10.0 inches/second 13.0: 13.0 inches/second 14.0: 14.0 inches/second @param density Print Density in the range from 0 to 15 @sensor Media Sensor Type @sensorDistance Sensor Distance - Vertical gap height of the gap/black mark in mm @sensorOffset Sensor Offset - Shift distance of the gap/black mark in mm.
startCommunication() Future<bool>
Open the communication to the printer. returns true on success, false on failure.
toggleBle(bool enable) Future<bool>
Call to enable disable BLE
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

dotsToMillimeters(double resolution, double dots) → dynamic
inchesToDot(double resolution, double inches) double
millimeterToDots(double resolution, double millimeters) double