Class EmbosserTools


  • public class EmbosserTools
    extends Object
    Provides tools related to embosser communication.
    • Field Detail

    • Constructor Detail

      • EmbosserTools

        public EmbosserTools()
    • Method Detail

      • toBytes

        public static byte[] toBytes​(int val,
                                     int size)
        Converts an integer to bytes and padding the value with zeros to the required size.
        Parameters:
        val - the value to convert
        size - the number of bytes to output
        Returns:
        returns a zero padded byte array containing the value
        Throws:
        IllegalArgumentException - if the integer value requires more bytes than specified by size.
      • getWidth

        public static int getWidth​(Dimensions dim,
                                   double unit)
        Get width, in units.
        Parameters:
        dim - the dimensions
        unit - unit in mm
        Returns:
        returns width in units
      • getHeight

        public static int getHeight​(Dimensions dim,
                                    double unit)
        Get height, in units.
        Parameters:
        dim - the dimensions
        unit - unit in mm
        Returns:
        returns width in units