com.asprise.imaging.scan.win

## Class WiaScanManager

- java.lang.Object
- - com.asprise.imaging.scan.ScanManager
  - - com.asprise.imaging.scan.win.WiaScanManager

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class WiaScanManager
      extends ScanManager

  Scan manager on Windows.

- - ### Field Summary

    - ### Fields inherited from class com.asprise.imaging.scan.ScanManager

      `VERSION`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `convertImage(String sourceFiles, String targetFile, String targetFormat, int jpegQuality, String tiffCompressionScheme)` Converts image(s) into another format.
    `static WiaScanManager` | `createNewInstance()`
    `String` | `doTest(String s)`
    `List<Device>` | `getDevices()` Lists all the devices available on the system.
    `static WiaScanManager` | `getInstance()` Singleton instance
    `String` | `getLibraryVersion()`
    `int` | `getWiaVersion()`
    `void` | `load()` Initializes the manager.
    `File[]` | `quickScanUsingUI(File destinationFolder, Component parentComponentForDialog, String preferredFormat)` Performs a quick scan using system UI.
    `Device` | `refreshDevice(String deviceId)`
    `Device` | `selectDeviceByIdOrName(String idOrName)` Selects the device by id or name.
    `String` | `selectDeviceUsingUI(Component parentComponentForDialog)` Prompts the system dialog in modal mode to allow the user to select a device
    `void` | `setWiaVersion(int version)` Selects WIA version, Windows XP supports v1 only while Vista, 7, 8 support both v1 and v2.
    `String` | `toString()`
    `void` | `unload()` Releases resources and invalidates the manager.

    - ### Methods inherited from class com.asprise.imaging.scan.ScanManager

      `createDefaultManager, enableLogDebugToConsole, getDefaultExecutorServiceForScanning, getDefaultManager, getTempFolder, isActive, isEnabledLogDebugToConsole, log, logDebug, logDebug, logDebugToConsole, logError, logError, logInfo, logInfo, logWarn, logWarn, main, quickScanUsingUI, quickScanUsingUI, selectDeviceUsingUI, setLoggerObject`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### setWiaVersion

          public void setWiaVersion(int version)

      Selects WIA version, Windows XP supports v1 only while Vista, 7, 8 support both v1 and v2.
      Parameters:
        `version` - 1 or 2

    - #### getWiaVersion

          public int getWiaVersion()

    - #### getInstance

          public static WiaScanManager getInstance()

      Singleton instance
      Returns:

    - #### createNewInstance

          public static WiaScanManager createNewInstance()

    - #### getDevices

          public List<Device> getDevices()
                                  throws ScanException

      Description copied from class: `ScanManager`
      Lists all the devices available on the system.
      Specified by:
        `getDevices` in class `ScanManager`
      Returns:
      Throws:
        `ScanException`

    - #### selectDeviceByIdOrName

          public Device selectDeviceByIdOrName(String idOrName)
                                        throws ScanException

      Description copied from class: `ScanManager`
      Selects the device by id or name.
      Specified by:
        `selectDeviceByIdOrName` in class `ScanManager`
      Returns:
      Throws:
        `ScanException`

    - #### selectDeviceUsingUI

          public String selectDeviceUsingUI(Component parentComponentForDialog)
                                     throws ScanException

      Description copied from class: `ScanManager`
      Prompts the system dialog in modal mode to allow the user to select a device
      Specified by:
        `selectDeviceUsingUI` in class `ScanManager`
      Parameters:
        `parentComponentForDialog` - an optional UI component that owns the device selection dialog (modal).
      Returns:
        the id of the device selected.
      Throws:
        `ScanException`

    - #### refreshDevice

          public Device refreshDevice(String deviceId)
                               throws ScanException

      Throws:
        `ScanException`

    - #### quickScanUsingUI

          public File[] quickScanUsingUI(File destinationFolder,
                                Component parentComponentForDialog,
                                String preferredFormat)
                                  throws ScanException

      Description copied from class: `ScanManager`
      Performs a quick scan using system UI.
      Specified by:
        `quickScanUsingUI` in class `ScanManager`
      Parameters:
        `destinationFolder` - folder to save scanned images into. Pass `null` to use system temp.
        `parentComponentForDialog` - an optional UI component that owns the device selection dialog (modal).
        `preferredFormat` - e.g., 'jpg', 'png' - no guarantee
      Returns:
        the scanned images or `null`/empty array if user cancelled
      Throws:
        `ScanException`

    - #### convertImage

          public void convertImage(String sourceFiles,
                          String targetFile,
                          String targetFormat,
                          int jpegQuality,
                          String tiffCompressionScheme)
                            throws ScanException

      Converts image(s) into another format.
      Specified by:
        `convertImage` in class `ScanManager`
      Parameters:
        `sourceFiles` - file paths separated by ; (single file in most cases, multiple for combining files into TIFF).
        `targetFile` - target output file - will be deleted first then written.
        `targetFormat` - FormatID - see WiaConstants.wiaFormatBMP
        `jpegQuality` - jpeg quality valid value 1 ~ 100.
        `tiffCompressionScheme` - tiff compression scheme - LZW (default), CCITT3, CCITT4, RLE, or Uncompressed
      Throws:
        `ScanException`

    - #### load

          public void load()
                    throws ScanException

      Description copied from class: `ScanManager`
      Initializes the manager.
      Specified by:
        `load` in class `ScanManager`
      Throws:
        `ScanException`

    - #### unload

          public void unload()
                      throws ScanException

      Description copied from class: `ScanManager`
      Releases resources and invalidates the manager.
      Specified by:
        `unload` in class `ScanManager`
      Throws:
        `ScanException`

    - #### close

          public void close()
                     throws IOException

      Throws:
        `IOException`

    - #### getLibraryVersion

          public String getLibraryVersion()
                                   throws ScanException

      Specified by:
        `getLibraryVersion` in class `ScanManager`
      Throws:
        `ScanException`

    - #### doTest

          public String doTest(String s)

Copyright © Asprise Software. All Rights Reserved. Please visit the product page at asprise.com