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()

reconnect allows the user to reconnect to a recently disconnected printer. This should only be used when there was a previous system disconnect (one that was not initiated by the user calling disconnect() explicitly).

disconnect()

disconnect allows the user to disconnect from the connected printer.

print(Context context, Template template, PrintingOptions printingOptions, Boolean dontPrintTrailerFlag)

print allows the user to print a selected template to the connected printer using PrintingOptions to do so. returns a PrintingStatus object.

  • context: A Context object that represents a UI context
  • 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. Input "null" if 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.

disconnectWithoutForget()

disconnectWithoutForget 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(Context context, Bitmap bitmap, PrintingOptions printingOptions, Boolean dontPrintTrailerFlag)

print allows the user to print an image in the form of a bitmap to the connected printer using PrintingOptions to do so. Images supported include PNG, JPG, JPEG, WEBP, and SVG. Returns a PrintingStatus object.

  • context: A Context object that represents a UI context
  • bitmap: The image in the form of a bitmap object.
  • printingOptions: The PrintingOptions object that holds the information of how to print.
  • dontPrintTrailerFlag: A Boolean flag. Input "null" if 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(Context context, Bitmap bitmap, Double bitmapWidth, Double labelLength, PrintingOptions printingOptions, Boolean dontPrintTrailerFlag);

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
  • bitmap: the image that we want to print.
  • bitmapWidth: 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)

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.

  • template: The template object to compare.

getPrinterStatus()

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

getPrinterName()

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

getPrinterModel()

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

getConnectionType()

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

getBatteryLevelPercentage()

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

getIsAcConnected()

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

getPrinterStatusMessage

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

getPrinterStatusRemedyExplanationMessage()

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

getPrinterStatusMessageTitle()

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

getSubstrateWidthInInches()

getSubstrateWidthInInches returns a Double that represents the width of the connected printer's substrate (will return 0 if the connected printer is not applicable).

getSubstrateHeightInInches()

getSubstrateHeightInInches return a Double that represents the height of the connected printer's substrate (will return 0 if the connected printer is not applicable).

getSupplyName()

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

getSupplyRemainingPercentage()

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.

getRibbonName()

getRibbonName returns a String that represents the name of the ribbon loaded in the printer (will return an empty string if the connected printer not applicable).

getRibbonRemainingPercentage()

getRibbonRemainingPercentage returns an Integer that represents the amount of ribbon remaining as a percentage (will return 0 if the connected printer is not applicable).

getSupplyDimensions()

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

cutLabel()

cutLabel sends the cut printer operation to the printer to cut a label.

feed()

feed sends the feed operation to the printer to feed a label.

turnOff(int timeInMinutes)

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.