public class WiaScanManager extends ScanManager
VERSION
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.
|
createDefaultManager, enableLogDebugToConsole, getDefaultExecutorServiceForScanning, getDefaultManager, getTempFolder, isActive, isEnabledLogDebugToConsole, log, logDebug, logDebug, logDebugToConsole, logError, logError, logInfo, logInfo, logWarn, logWarn, main, quickScanUsingUI, quickScanUsingUI, selectDeviceUsingUI, setLoggerObject
public void setWiaVersion(int version)
version
- 1 or 2public int getWiaVersion()
public static WiaScanManager getInstance()
public static WiaScanManager createNewInstance()
public List<Device> getDevices() throws ScanException
ScanManager
getDevices
in class ScanManager
ScanException
public Device selectDeviceByIdOrName(String idOrName) throws ScanException
ScanManager
selectDeviceByIdOrName
in class ScanManager
ScanException
public String selectDeviceUsingUI(Component parentComponentForDialog) throws ScanException
ScanManager
selectDeviceUsingUI
in class ScanManager
parentComponentForDialog
- an optional UI component that owns the device selection dialog (modal).ScanException
public Device refreshDevice(String deviceId) throws ScanException
ScanException
public File[] quickScanUsingUI(File destinationFolder, Component parentComponentForDialog, String preferredFormat) throws ScanException
ScanManager
quickScanUsingUI
in class ScanManager
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 guaranteenull
/empty array if user cancelledScanException
public void convertImage(String sourceFiles, String targetFile, String targetFormat, int jpegQuality, String tiffCompressionScheme) throws ScanException
convertImage
in class ScanManager
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.wiaFormatBMPjpegQuality
- jpeg quality valid value 1 ~ 100.tiffCompressionScheme
- tiff compression scheme - LZW (default), CCITT3, CCITT4, RLE, or UncompressedScanException
public void load() throws ScanException
ScanManager
load
in class ScanManager
ScanException
public void unload() throws ScanException
ScanManager
unload
in class ScanManager
ScanException
public void close() throws IOException
IOException
public String getLibraryVersion() throws ScanException
getLibraryVersion
in class ScanManager
ScanException
Copyright © Asprise Software. All Rights Reserved. Please visit the product page at asprise.com