PrinterDetails

The Brady SDK PrinterDetails object is returned after attempting a connection to a printer. It holds all of the information about the printer that the user may need.

reconnect() async

reconnect allows the user to reconnect to a recently disconnected printer. Returns a boolean that represents if the reconnect was successful.

disconnect() async -> Bool

disconnect allows the user to disconnect from the connected printer.

disconnectWithoutForget() async -> Bool

disconenctWithoutForget disconnects from the current printer without forgetting it internally allowing future auto-connects. Calling this immediately before PrinterDetails.forgetLastConnectedPrinter() will result in the same functionality as calling the normal "disconnect" method. Therefore, disconnectWithoutForget + forgetLastConnectedPrinter = disconnect.

print(template: Template, printingOptions: PrintingOptions, dontPrintTrailerFlag: Bool) async -> PrintingStatus

print allows the user to print a selected template to the connected printer using PrintingOptions to do so. Returns the PrintingStatus when finished.

  • template: The Template object that we want to print.
  • printingOptions: The PrintingOptions object that holds the information of how to print.
  • dontPrintTrailerFlag: A Boolean flag. Pass in false if the connected printer is not an M211.
    • If true, don't print a trailer on the end of a label during the print.
    • If false, print a trailer on the end of a label during the print.

print(image: UIImage, printingOptions: PrintingOptions, dontPrintTrailerFlag: Bool) async -> PrintingStatus

print allows the user to print a selected image file to the connected printer using PrintingOptions to do so. Returns the PrintingStatus when finished.

  • image: The UIImage object that we want to print.
  • printingOptions: The PrintingOptions object that holds the information of how to print.
  • dontPrintTrailerFlag: A Boolean flag. Pass in false if the connected printer is not an M211.
    • If true, don't print a trailer on the end of a label during the print.
    • If false, print a trailer on the end of a label during the print.

print(image: UIImage, imageWidth: Double, labelLength: Double, printingOptions: PrintingOptions, dontPrintTrailerFlag: Bool) async -> PrintingStatus

print allows the user to instead specify the width of the image and the length of the label in inches in order to print an image. The purpose of this method is to allow a user to resize how the image appears on the label if they are unhappy with the defaulted outcome. Returns the PrintingStatus when finished.

For example: This method is useful if the desired image to print is not square. Since the physical supply width cannot change, increasing the labelLength value might begin to eliminate wasted space on a label since the image will have more room to grow to fit. Vice versa, if the image does not entirely fit on a label, you may decrease the imageWidth value to shrink the image to fit on the label fully.

  • context: A Context object that represents a UI context
  • image: the image that we want to print.
  • imageWidth: allows the user to customize the width (in inches) of the image once it prints instead of using the default.
  • labelLength: allows the user to customize the length (in inches) of the label instead of using the default. Currently, M611 continuous parts have a length of 0.5 inches before being overrided according to the information we receive from the printer. The width (in inches) will always be stated on the physical part.
  • printingOptions: the PrintingOptions object that holds the information of how to print.
  • dontPrintTrailerFlag: If true, don't print trailer white space after the printed label. If false, print one.

checkForPartMismatch(template: Template) throws -> Bool

checkForPartMismatch compares the part in the connected printer to the part used to create the template. Returns true if the parts match, false if they are different. Can also throw errors.

  • template: The template object to compare.

getPrinterStatus() -> PrinterStatus

getPrinterStatus returns the PrinterStatus enumeration that describes the state of the printer's connection.

getPrinterName() -> String

getPrinterName returns a String that represents the name of the connected printer.

getPrinterModel() -> String

getPrinterModel returns a String that represents the model of the connected printer.

getConnectionType() -> ConnectionType

getConnectionType returns the ConnectionType enumeration that describes how we are connected to the printer.

getBatteryLevelPercentage() -> Int

getBatteryLevelPercentage returns an Integer that represents roughly the battery life percentage of the printer.

getIsAcConnected() -> Bool

getIsAcConnected returns a Boolean that represents whether this printer is plugged into an outlet and on AC power.

getPrinterStatusMessage -> String

getPrinterStatusMessage returns a String that represents the body of a printer error message.

getPrinterStatusRemedyExplanationMessage() -> String

getPrinterStatusRemedyExplanationMessage returns a String that represents the remedy to a printer error.

getPrinterStatusMessageTitle() -> String

getPrinterStatusMessageTitle returns a String that represents the title of the printer error.

getSupplyName() -> String

getSupplyName returns a String that represents the full name of the part loaded in the connected printer.

getSupplyWidth() -> Double

getSupplyWidth returns a Double that represents the Width in inches of the supply installed in the printer.

getSupplyHeight() -> Double

getSupplyHeight return a Double that represents the Height in inches of the supply installed in the printer.

getSupplyRemainingPercentage() -> Int

getSupplyRemainingPercentage returns an Integer that represents the percentage of remaining supply in the connected printer.

getIsSupplyPreSized()

getIsSupplyPreSized() returns a Boolean that represents if the installed part in the connected printer is a pre-sized part. If false, the part could be continuous or another part not categorized as die-cut.

getSupplyDimensions() -> String

getSupplyDimensions returns a String that represents the supply dimensions (width and height).

cutLabel() async -> Bool?

cutLabel sends the cut printer operation to the printer to cut a label. This operation is asynchronous and returns a nullable Boolean representing if the operation was successful or not.

feed() async -> Bool?

feed sends the feed operation to the printer to feed a label. This operation is asynchronous and returns a nullable Boolean representing if the operation was successful or not.

turnOff(timeInMinutes: Int)

turnOff sets the automatic shutdown time of the printer in minutes.

  • timeInMinutes: An Integer that represents the amount of minutes it takes for the connected printer to shut down automatically. If this is set to zero, it will not change the current value.