Class PrinterDevice

  • All Implemented Interfaces:
    Device

    public class PrinterDevice
    extends Object
    implements Device
    Printer device class of type DocFlavor.INPUT_STREAM.AUTOSENSE

    This class can be used when sending a file to a printer.

    • Constructor Detail

      • PrinterDevice

        public PrinterDevice​(String deviceName,
                             boolean fuzzyLookup)
        Create a device with the provided name.
        Parameters:
        deviceName - the name of the device
        fuzzyLookup - If true, the returned device is any device whose name contains the supplied deviceName. If false, the returned device name equals the supplied deviceName.
        Throws:
        IllegalArgumentException - if no device is found.
    • Method Detail

      • getDevices

        public static PrintService[] getDevices()
        List available devices.
        Returns:
        returns a list of available devices that accepts DocFlavor.INPUT_STREAM.AUTOSENSE
      • transmit

        public void transmit​(File file)
                      throws PrintException
        Transmit a file to the device. Transmit a file to the device.
        Specified by:
        transmit in interface Device
        Parameters:
        file - the file to transmit
        Throws:
        PrintException - if a print exception occurs