JTwain v9 - Lab Asprise! All Rights Reserved.

com.asprise.util.jtwain
Class Source

java.lang.Object
  extended bycom.asprise.util.jtwain.Source
All Implemented Interfaces:
JTwainConstants

public class Source
extends Object
implements JTwainConstants

The Source class represents a TWAIN data source. The Source can be a scanner, digital camera or a image database. The following code illustrates an image acquisition session:

 Source source = SourceManager.instance().getDefaultSource(); // Get the default Source
 try {
 	source.open();
 	... // Get/Set the Source's capabilities here ...
 
 	Image image = source.acuqireImage();
 	... // Use image here ...
 }catch(Exception e) {
 	e.printStackTrace();
 }finally{
 	SourceManager.instance().closeSourceManager();
 }
 
There are many other ways to obtain a data source. To let the user select from a dialog:
 Source source = SourceManager.selectSourceUI();
 

See Also:
SourceManager

Field Summary
static int EXCEPTION_THROW_ALL
           
static int EXCEPTION_THROW_MINIMUM
           
static int EXCEPTION_THROW_SOME
           
static int INVALID_NUMBER
           
 
Fields inherited from interface com.asprise.util.jtwain.JTwainConstants
ACAP_AUDIOFILEFORMAT, ACAP_XFERMECH, CAP_ALARMS, CAP_ALARMVOLUME, CAP_AUTHOR, CAP_AUTOFEED, CAP_AUTOMATICCAPTURE, CAP_AUTOSCAN, CAP_BATTERYMINUTES, CAP_BATTERYPERCENTAGE, CAP_CAMERAPREVIEWUI, CAP_CAPTION, CAP_CLEARBUFFERS, CAP_CLEARPAGE, CAP_CUSTOMBASE, CAP_CUSTOMDSDATA, CAP_DEVICEEVENT, CAP_DEVICEONLINE, CAP_DEVICETIMEDATE, CAP_DUPLEX, CAP_DUPLEXENABLED, CAP_ENABLEDSUIONLY, CAP_ENDORSER, CAP_EXTENDEDCAPS, CAP_FEEDERALIGNMENT, CAP_FEEDERENABLED, CAP_FEEDERLOADED, CAP_FEEDERORDER, CAP_FEEDPAGE, CAP_INDICATORS, CAP_JOBCONTROL, CAP_LANGUAGE, CAP_MAXBATCHBUFFERS, CAP_PAPERDETECTABLE, CAP_POWERSUPPLY, CAP_PRINTER, CAP_PRINTERENABLED, CAP_PRINTERINDEX, CAP_PRINTERMODE, CAP_PRINTERSTRING, CAP_PRINTERSUFFIX, CAP_REACQUIREALLOWED, CAP_REWINDPAGE, CAP_SERIALNUMBER, CAP_SUPPORTEDCAPS, CAP_SUPPORTEDCAPSEXT, CAP_THUMBNAILSENABLED, CAP_TIMEBEFOREFIRSTCAPTURE, CAP_TIMEBETWEENCAPTURES, CAP_TIMEDATE, CAP_UICONTROLLABLE, CAP_XFERCOUNT, DAT_AUDIOFILEXFER, DAT_AUDIOINFO, DAT_AUDIONATIVEXFER, DAT_CAPABILITY, DAT_CIECOLOR, DAT_CUSTOMBASE, DAT_CUSTOMDSDATA, DAT_DEVICEEVENT, DAT_EVENT, DAT_EXTIMAGEINFO, DAT_FILESYSTEM, DAT_GRAYRESPONSE, DAT_IDENTITY, DAT_IMAGEFILEXFER, DAT_IMAGEINFO, DAT_IMAGELAYOUT, DAT_IMAGEMEMXFER, DAT_IMAGENATIVEXFER, DAT_JPEGCOMPRESSION, DAT_NULL, DAT_PALETTE8, DAT_PARENT, DAT_PASSTHRU, DAT_PENDINGXFERS, DAT_RGBRESPONSE, DAT_SETUPFILEXFER, DAT_SETUPFILEXFER2, DAT_SETUPMEMXFER, DAT_STATUS, DAT_TWUNKIDENTITY, DAT_USERINTERFACE, DAT_XFERGROUP, DEBUG, ICAP_AUTOBRIGHT, ICAP_AUTOMATICBORDERDETECTION, ICAP_AUTOMATICDESKEW, ICAP_AUTOMATICROTATE, ICAP_BARCODEDETECTIONENABLED, ICAP_BARCODEMAXRETRIES, ICAP_BARCODEMAXSEARCHPRIORITIES, ICAP_BARCODESEARCHMODE, ICAP_BARCODESEARCHPRIORITIES, ICAP_BARCODETIMEOUT, ICAP_BITDEPTH, ICAP_BITDEPTHREDUCTION, ICAP_BITORDER, ICAP_BITORDERCODES, ICAP_BRIGHTNESS, ICAP_CCITTKFACTOR, ICAP_COMPRESSION, ICAP_CONTRAST, ICAP_CUSTHALFTONE, ICAP_EXPOSURETIME, ICAP_EXTIMAGEINFO, ICAP_FILTER, ICAP_FLASHUSED, ICAP_FLASHUSED2, ICAP_FLIPROTATION, ICAP_FRAMES, ICAP_GAMMA, ICAP_HALFTONES, ICAP_HIGHLIGHT, ICAP_IMAGEDATASET, ICAP_IMAGEFILEFORMAT, ICAP_IMAGEFILTER, ICAP_JPEGPIXELTYPE, ICAP_JPEGQUALITY, ICAP_LAMPSTATE, ICAP_LIGHTPATH, ICAP_LIGHTSOURCE, ICAP_MAXFRAMES, ICAP_MINIMUMHEIGHT, ICAP_MINIMUMWIDTH, ICAP_NOISEFILTER, ICAP_ORIENTATION, ICAP_OVERSCAN, ICAP_PATCHCODEDETECTIONENABLED, ICAP_PATCHCODEMAXRETRIES, ICAP_PATCHCODEMAXSEARCHPRIORITIES, ICAP_PATCHCODESEARCHMODE, ICAP_PATCHCODESEARCHPRIORITIES, ICAP_PATCHCODETIMEOUT, ICAP_PHYSICALHEIGHT, ICAP_PHYSICALWIDTH, ICAP_PIXELFLAVOR, ICAP_PIXELFLAVORCODES, ICAP_PIXELTYPE, ICAP_PLANARCHUNKY, ICAP_ROTATION, ICAP_SHADOW, ICAP_SUPPORTEDBARCODETYPES, ICAP_SUPPORTEDPATCHCODETYPES, ICAP_SUPPORTEDSIZES, ICAP_THRESHOLD, ICAP_TILES, ICAP_TIMEFILL, ICAP_UNDEFINEDIMAGESIZE, ICAP_UNITS, ICAP_XFERMECH, ICAP_XNATIVERESOLUTION, ICAP_XRESOLUTION, ICAP_XSCALING, ICAP_YNATIVERESOLUTION, ICAP_YRESOLUTION, ICAP_YSCALING, ICAP_ZOOMFACTOR, JT_ACTION_CLOSE_DS, JT_ACTION_CLOSE_SM, JT_ACTION_LOAD_SM, JT_ACTION_OPEN_DS, JT_ACTION_OPEN_SM, JT_ACTION_SELECT_DS, JT_ACTION_UNLOAD_SM, JT_STATE_DS_ENABLED, JT_STATE_DS_NOT_IN_USE, JT_STATE_DS_OPEN, JT_STATE_SM_LOADED, JT_STATE_SM_NOT_LOADED, JT_STATE_SM_OPEN, JT_STATE_TRANSFER_READY, JT_STATE_TRANSFERING, JT_STATE_UNKNOWN, MSG_GET, MSG_GETCURRENT, MSG_GETDEFAULT, MSG_GETFIRST, MSG_GETNEXT, MSG_QUERYSUPPORT, MSG_RESET, MSG_SET, TWAIN_STATE_DS_ENABLED, TWAIN_STATE_DS_OPEN, TWAIN_STATE_PRESESSION, TWAIN_STATE_SM_LOADED, TWAIN_STATE_SM_OPEN, TWAIN_STATE_TRANSFER_READY, TWAIN_STATE_TRANSFERING, TWBO_LSBFIRST, TWBO_MSBFIRST, TWCC_BADCAP, TWCC_BADDEST, TWCC_BADPROTOCOL, TWCC_BADVALUE, TWCC_BUMMER, TWCC_CAPBADOPERATION, TWCC_CAPSEQERROR, TWCC_CAPUNSUPPORTED, TWCC_CHECKDEVICEONLINE, TWCC_CUSTOMBASE, TWCC_DENIED, TWCC_FILEEXISTS, TWCC_FILENOTFOUND, TWCC_FILEWRITEERROR, TWCC_LOWMEMORY, TWCC_MAXCONNECTIONS, TWCC_NODS, TWCC_NOTEMPTY, TWCC_OPERATIONERROR, TWCC_PAPERDOUBLEFEED, TWCC_PAPERJAM, TWCC_SEQERROR, TWCC_SUCCESS, TWCP_BITFIELDS, TWCP_GROUP31D, TWCP_GROUP31DEOL, TWCP_GROUP32D, TWCP_GROUP4, TWCP_JBIG, TWCP_JPEG, TWCP_LZW, TWCP_NONE, TWCP_PACKBITS, TWCP_PNG, TWCP_RLE4, TWCP_RLE8, TWFF_BMP, TWFF_EXIF, TWFF_FPX, TWFF_JFIF, TWFF_PICT, TWFF_PNG, TWFF_SPIFF, TWFF_TIFF, TWFF_TIFFMULTI, TWFF_XBM, TWFT_BLACK, TWFT_BLUE, TWFT_CYAN, TWFT_GREEN, TWFT_MAGENTA, TWFT_NONE, TWFT_RED, TWFT_WHITE, TWFT_YELLOW, TWLP_REFLECTIVE, TWLP_TRANSMISSIVE, TWLS_BLUE, TWLS_GREEN, TWLS_IR, TWLS_NONE, TWLS_RED, TWLS_UV, TWLS_WHITE, TWON_ARRAY, TWON_DONTCARE16, TWON_DONTCARE32, TWON_DONTCARE8, TWON_DSMCODEID, TWON_DSMID, TWON_ENUMERATION, TWON_ICONID, TWON_ONEVALUE, TWON_RANGE, TWOR_LANDSCAPE, TWOR_PORTRAIT, TWOR_ROT0, TWOR_ROT180, TWOR_ROT270, TWOR_ROT90, TWPC_CHUNKY, TWPC_PLANAR, TWPF_CHOCOLATE, TWPF_VANILLA, TWPT_BW, TWPT_CIEXYZ, TWPT_CMY, TWPT_CMYK, TWPT_GRAY, TWPT_PALETTE, TWPT_RGB, TWPT_YUV, TWPT_YUVK, TWQC_GET, TWQC_GETCURRENT, TWQC_GETDEFAULT, TWQC_RESET, TWQC_SET, TWRC_CANCEL, TWRC_CHECKSTATUS, TWRC_CUSTOMBASE, TWRC_DATANOTAVAILABLE, TWRC_DSEVENT, TWRC_ENDOFLIST, TWRC_FAILURE, TWRC_INFONOTSUPPORTED, TWRC_NOTDSEVENT, TWRC_SUCCESS, TWRC_XFERDONE, TWSS_2A0, TWSS_4A0, TWSS_A0, TWSS_A1, TWSS_A10, TWSS_A2, TWSS_A3, TWSS_A4, TWSS_A4LETTER, TWSS_A5, TWSS_A6, TWSS_A7, TWSS_A8, TWSS_A9, TWSS_B3, TWSS_B4, TWSS_B5LETTER, TWSS_B6, TWSS_BUSINESSCARD, TWSS_C0, TWSS_C1, TWSS_C10, TWSS_C2, TWSS_C3, TWSS_C4, TWSS_C5, TWSS_C6, TWSS_C7, TWSS_C8, TWSS_C9, TWSS_ISOB0, TWSS_ISOB1, TWSS_ISOB10, TWSS_ISOB2, TWSS_ISOB3, TWSS_ISOB4, TWSS_ISOB5, TWSS_ISOB6, TWSS_ISOB7, TWSS_ISOB8, TWSS_ISOB9, TWSS_JISB0, TWSS_JISB1, TWSS_JISB10, TWSS_JISB2, TWSS_JISB3, TWSS_JISB4, TWSS_JISB5, TWSS_JISB6, TWSS_JISB7, TWSS_JISB8, TWSS_JISB9, TWSS_NONE, TWSS_USEXECUTIVE, TWSS_USLEDGER, TWSS_USLEGAL, TWSS_USLETTER, TWSS_USSTATEMENT, TWSX_FILE, TWSX_FILE2, TWSX_MEMORY, TWSX_NATIVE, TWTY_BOOL, TWTY_FIX32, TWTY_FRAME, TWTY_INT16, TWTY_INT32, TWTY_INT8, TWTY_STR1024, TWTY_STR128, TWTY_STR255, TWTY_STR32, TWTY_STR64, TWTY_UINT16, TWTY_UINT32, TWTY_UINT8, TWTY_UNI512, TWUN_CENTIMETERS, TWUN_INCHES, TWUN_PICAS, TWUN_PIXELS, TWUN_POINTS, TWUN_TWIPS
 
Constructor Summary
Source(DataTypeIdentity identity)
          Creates a new Source with full identity.
Source(String sourceName)
          Creates a new Source.
 
Method Summary
 Image acquireImage()
          Acquires an image.
 BufferedImage acquireImageAsBufferedImage()
          Acquires an image and returns it as a BufferedImage.
 void close()
          Closes the Source.
 int[] getAlarms()
          Get available alarms.
 int[] getAlarmVolume()
          Get alarm volumes.
 String getAuthor()
          Get author of acquired image (may include a copyright string).
 boolean getAutoBright()
          Get status of the source's auto-brightness function.
 boolean[] getAutoFeed()
          Get AutoFeed abilities.
 boolean getAutomaticBorderDetection()
          Get automatic border detection status.
 int getAutomaticCapture()
          Get number of images to automatically capture.
 boolean getAutomaticDeskew()
          Get automatic deskew status.
 boolean getAutomaticRotate()
          Get automatic rotate status.
 boolean getAutoScan()
          Get status of auto scan.
 boolean getBarCodeDetectionEnabled()
          Get status of bar code detection.
 int[] getBitDepth()
          Get the bit depth values of ICAP_PIXELTYPE.
 int[] getBitOrder()
          Get the bit orders (how the bytes in an image are filled by the Source).
static boolean getBoolean(Object o)
          Extract boolean value from an object.
static boolean[] getBooleanArray(Object o)
          Extract a boolean array from an object.
 double[] getBrightness()
          The brightness values available within the Source.
 Object getCapability(int mesgType, int capabilityCode, int expectedContainerType)
          Get a capability.
 String getCaption()
          Get a general note about the acquired image.
 int getClearBuffers()
          Reports the presence of data in the scanner’s buffers.
 boolean getClearPage()
          Get clear page status.
 int[] getCompression()
          Common compression schemes shared by both the source and the application for Buffered Memory and File Transfer.
 double[] getContrast()
          The contrast values available within the Source.
 int getCurrentAlarmVolume()
          Get current alarm volume.
 boolean getCurrentAutoFeed()
          Get current AutoFeed status.
 boolean getCurrentAutomaticBorderDetection()
          Get current automatic border detection status.
 int getCurrentAutomaticCapture()
          Get current number of images to automatically capture.
 boolean getCurrentAutomaticDeskew()
          Get current automatic deskew status.
 boolean getCurrentAutomaticRotate()
          Get current automatic rotate status.
 int getCurrentBitDepth()
          Get the current bit depth value of ICAP_PIXELTYPE.
 int getCurrentBitOrder()
          Get the current bit orders (how the bytes in an image are filled by the Source).
 boolean getCurrentClearPage()
          Get current clear page status.
 int getCurrentCompression()
          Get current common compression schemes shared by both the source and the application for Buffered Memory and File Transfer [Current value].
 boolean getCurrentFeederEnabled()
          Get current feeder enabled status.
 boolean getCurrentFeederLoaded()
          Get current feeder loaded status.
 boolean getCurrentFeedPage()
          Get current feed page status.
 int getCurrentFlipRotation()
          Get current flip rotation option.
 double[] getCurrentFrame()
          Returns the size and location of the next frame to be acquired.
 double getCurrentPhyscialWidth()
          Get the maximum physical width (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Current value].
 double getCurrentPhysicalHeight()
          Get the maximum physical height (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Current value].
 int getCurrentPixelFlavor()
          Get the current pixel flavor - sense of the pixel whose numeric value is zero.
 int getCurrentPixelType()
          Get current type of pixel data that a source is capable of acquiring.
 int getCurrentPlanarChunky()
          Get current color data format [Current value].
 boolean getCurrentRewindPage()
          Get current rewind page status.
 int getCurrentTransferCount()
          Get the number of images to be transferred in this session [Current value].
 int getCurrentTransferMechanism()
          Get the current transfer mechanism.
 int[] getCurrentUnits()
          Get the current unit of measure for all quantities.
 double getCurrentXResolution()
          Get the current X-axis resolution, measured in ICAP_UNITS.
 double getCurrentYResolution()
          Get the current Y-axis resolution, measured in ICAP_UNITS.
 boolean getDefaultAutoFeed()
          Get default AutoFeed status.
 boolean getDefaultAutomaticBorderDetection()
          Get default automatic border detection status.
 int getDefaultAutomaticCapture()
          Get default number of images to automatically capture.
 boolean getDefaultAutomaticDeskew()
          Get default automatic deskew status.
 boolean getDefaultAutomaticRotate()
          Get default automatic rotate status.
 int getDefaultBitDepth()
          Get the default bit depth value of ICAP_PIXELTYPE.
 int getDefaultBitOrder()
          Get the default bit orders (how the bytes in an image are filled by the Source).
 boolean getDefaultClearPage()
          Get default clear page status.
 int getDefaultCompression()
          Get default common compression scheme shared by both the source and the application for Buffered Memory and File Transfer [Default value].
 boolean getDefaultFeederEnabled()
          Get default feeder enabled status.
 boolean getDefaultFeederLoaded()
          Get default feeder loaded status.
 boolean getDefaultFeedPage()
          Get default feed page status.
 int getDefaultFlipRotation()
          Get default flip rotation option.
 double getDefaultPhyscialWidth()
          Get the maximum physical width (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Default value].
 double getDefaultPhysicalHeight()
          Get the maximum physical height (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Default value].
 int getDefaultPixelType()
          Get default type of pixel data that a source is capable of acquiring.
 int getDefaultPlanarChunky()
          Get the default color format [Default value].
 boolean getDefaultRewindPage()
          Get default rewind page status.
 int getDefaulttPixelFlavor()
          Get the default pixel flavor - sense of the pixel whose numeric value is zero.
 int getDefaultTransferCount()
          Get the number of images to be transferred in this session [Default value].
 int getDefaultTransferMechanism()
          Get the default transfer mechanism.
 int[] getDefaultUnits()
          Get the default unit of measure for all quantities.
 double getDefaultXResolution()
          Get the default X-axis resolution, measured in ICAP_UNITS.
 double getDefaultYResolution()
          Get the default Y-axis resolution, measured in ICAP_UNITS.
 String getDeviceDateTime()
          Get the date and time of a device's clock.
 boolean getDeviceOnline()
          Determines if hardware in on and ready.
static double getDouble(Object o)
          Extract a double from an object.
static double[] getDoubleArray(Object o)
          Extract a double array from an object.
 int getDuplex()
          Gets the duplex mode supported by the scanner.
 boolean getDuplexEnabled()
          Get duplex status.
 int[] getExtendedCapabilities()
          Get a list of extended capabilities that can be used in States 5 and 6.
 String[] getExtendedCapabilitiessStrings()
          Get a human readable list of extended capabilities.
 boolean getFeederEnabled()
          Get feeder enabled status.
 boolean getFeederLoaded()
          Get feeder loaded status.
 boolean getFeedPage()
          Get feed page status.
 int getFlipRotation()
          Get flip rotation option.
 double[][] getFrames()
          Returns the size and location of all the frames the Source will acquire image data from when acquiring from each page.
 double getGamma()
          Get gamma correction value for image data.
 DataTypeIdentity getIdentity()
          Get the identity of this source.
 boolean getIndicators()
          Use the Source's progress indicator?
static int getInt(Object o)
          Extract an int from an object.
static int[] getIntArray(Object o)
          Extract an integer array from an object.
 Image getLastAcquiredImage()
          Gets the last acquired image.
 int[] getMaxBatchBuffers()
          Describes the number of pages that the scanner can buffer when CAP_AUTOSCAN is enabled.
 int getMaxFrames()
          Gets the maximum number of frames the Source can provide or the application can accept per page.
 boolean getMinimumExceptionEnabled()
          Gets the status of level of exception thrown.
 int getNumberOfPendingImages()
          Gets number of pending images.
 boolean getPatchCodeDetectionEnabled()
          Gets the status of patch code detection.
 double getPhyscialWidth()
          Get the maximum physical width (Y-axis) the source can acquire measured in the unit of ICAP_UNITS.
 double getPhysicalHeight()
          Get the maximum physical height (Y-axis) the source can acquire measured in the unit of ICAP_UNITS.
 int[] getPixelFlavor()
          Get the pixel flavors - sense of the pixel whose numeric value is zero.
 int[] getPixelType()
          Get types of pixel data that a source is capable of acquiring.
 int[] getPlanarChunky()
          Get all available color data formats.
 int[] getPrinter()
          Returns the current list of printer devices.
 boolean getPrinterEnabled()
          Current printer device on/off?
 int getPrinterMode()
          Returns the device mode of the current printer.
 String getPrinterString()
          Returns the printer string.
 DataTypeImageLayout getRegion()
          Returns the scanning region for next scan.
 boolean getRewindPage()
          Get rewind page status.
 String getSourceName()
          Gets name of the Source.
 int getState()
          Gets the state of the source.
 int[] getSupportedCapabilities()
          Get a list of all supported capabilities.
 String[] getSupportedCapabilitiesStrings()
          Get a human readable list of all supported capabilities.
 int[] getSupportedSizes()
          Gets the size(s) the Source can/should use to acquire image data.
 int getTransferCount()
          Get the number of images to be transferred in this session.
 int[] getTransferMechanism()
          Get transfer mechanisms supported by both the application and the source.
 boolean getUIControllable()
          Check whether the source supports acquisition with the UI disabled.
 int[] getUnits()
          Get the units of measure for all quantities.
 double[] getXResolution()
          Get all the X-axis resolutions that the source can provide, measured in ICAP_UNITS.
 double[] getYResolution()
          Get all the Y-axis resolutions that the source can provide, measured in ICAP_UNITS.
 boolean hasMoreImages()
          Tests whether there are pending images to be acquired.
 boolean isUIEnabled()
          Is the Source's user interface enabled?
 void open()
          Opens this data source.
 InputStream outputLastAcquiredImageAsJPEG()
          Returns the last acquired image in the JPEG format as a stream.
 void resetAutoFeed()
          Reset auto feed option.
 void resetAutomaticBorderDetection()
          Reset automatic border detection operation.
 void resetAutomaticCapture(int numberOfImages)
          Reet number of images to automatically capture.
 void resetAutomaticDeskew()
          Reset automatic rotate operation.
 void resetAutomaticRotate()
          Reset automatic rotate operation.
 void resetBitDepth()
          Reset the bit depth value of ICAP_PIXELTYPE.
 void resetBitOrder()
          Reset the current bit orders (how the bytes in an image are filled by the Source).
 void resetCapability(int capabilityCode)
          Reset a capability.
 void resetClearPage()
          Reset clear page option.
 void resetFeedPage()
          Reset feed page option.
 void resetFlipRotation()
          Reset flip rotation option.
 void resetPixelType()
          Reset the type of pixel data that a source is capable of acquiring.
 void resetRewindPage()
          Reset rewind page option.
 int resetTransferCount()
          Reset the number of images to be transferred in this session.
 void resetTransferMechanism()
          Reset the transfer mechanism.
 void resetUnits()
          Reset the unit of measure for all quantities.
 void resetXResolution()
          Reset the X-axis resolution.
 void resetYResolution()
          Reset the Y-axis resolution.
 void saveLastAcquiredImageIntoFile(File destination)
          Saves the last acquired image as JPEG into the given file.
 void saveLastAcquiredImageIntoFile(String destination)
          Saves the last acquired image as JPEG into the given file.
 File saveLastAcquiredImageIntoTemporaryFile()
          Saves the last acquired image as JPEG into a temporary file.
 void setAlarms(int[] alarms)
          Set alarms.
 void setAuthor(String author)
          Set author of acquired image (may include a copyright string).
 void setAutoBright(boolean enableAutoBright)
          Turn on or off the source's auto-brightness function.
 void setAutoFeed(boolean autoFeed)
          Set auto feed option.
 void setAutomaticBorderDetection(boolean enabled)
          Set automatic border detection operation.
 void setAutomaticCapture(int numberOfImages)
          Set number of images to automatically capture.
 void setAutomaticDeskew(boolean enabled)
          Set automatic rotate operation.
 void setAutomaticRotate(boolean enabled)
          Set automatic rotate operation.
 void setAutoScan(boolean autoScan)
          Set status of auto scan.
 void setBarCodeDetectionEnabled(boolean enableBarCodeDetection)
          Set status of bar code detection.
 void setBitDepth(int bitDepth)
          Set the bit depth value of ICAP_PIXELTYPE.
 void setBitOrder(int bitOrder)
          Set the current bit orders (how the bytes in an image are filled by the Source).
 void setBrightness(double[] values)
          Sets brightness values.
 void setCapability(int capabilityCode, ValueContainer container)
          Set a capability.
 void setCaption(String caption)
          Set a general note about the acquired image.
 void setClearBuffers(int option)
          Clears the buffers?
 void setClearPage(boolean clearPage)
          Set clear page option.
 void setCompression(int compression)
          Sets the compression [Not all compressions may be supported by the device!].
 void setContrast(double[] values)
          Sets constrast values.
 void setDuplexEnabled(boolean enable)
          Enables/Disables duplex.
 void setExtendedCapabilities(int[] extendedCaps)
          Set a list of extended capabilities that can be used in States 5 and 6.
 void setFeederEnabled(boolean feederEnabled)
          Set feeder enabled.
 void setFeedPage(boolean feedPage)
          Set feed page option.
 void setFlipRotation(int flipRotation)
          Set flip rotation option.
 void setFrames(double[] singleFrame)
          Specifies the single frame and its location to be used to acquire from future pages.
 void setFrames(double[][] multipleFrames)
          Specifies the frames and their locations to be used to acquire from future pages.
 void setGamma(double gamma)
          Set gamma correction value for image data.
 void setIndicators(boolean useProgressIndicator)
          Turn on/off the Source's progress indicator.
 void setMaxBatchBuffers(int size)
          Sets the current number pages to be buffered (if the Source allows this to be set) DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_MAXBATCHBUFFERS
 void setMaxFrames(int max)
          Sets the maximum number of frames the Source can provide or the application can accept per page.
 void setMinimumExceptionEnabled(boolean enableMinimumException)
          Allows only minimum set of exceptions to be thrown.
 void setPatchCodeDetectionEnabled(boolean enable)
          Turns patch code detection on and off.
 void setPixelType(int pixelType)
          Set the type of pixel data that a source is capable of acquiring.
 void setPrinter(int printer)
          Selects the current printer.
 void setPrinterEnabled(boolean enable)
          Turns current printer device on/off.
 void setPrinterString(String string)
          Sets the string component.
 void setRegion(double left, double top, double right, double bottom)
          Sets the scanning region for next scan.
 void setRewindPage(boolean rewindPage)
          Set rewind page option.
 void setSupportedSizes(int[] sizes)
          Sets the size(s) the Source can/should use to acquire image data.
 void setTransferCount(int count)
          Set the number of images to be transferred in this session.
 void setTransferMechanims(int transferMechanism)
          Set the default transfer mechanism.
 void setUIEnabled(boolean enableUI)
          Turns on/off the Source's user interface.
 void setUnits(int unitCode)
          Set the unit of measure for all quantities.
 void setXResolution(double xresolution)
          Set the X-axis resolution.
 void setYResolution(double Yresolution)
          Set the Y-axis resolution.
 String toString()
          String representation of the Source.
 String toString(boolean verbose)
          String representation of the Source.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INVALID_NUMBER

public static final int INVALID_NUMBER
See Also:
Constant Field Values

EXCEPTION_THROW_ALL

public static final int EXCEPTION_THROW_ALL
See Also:
Constant Field Values

EXCEPTION_THROW_SOME

public static final int EXCEPTION_THROW_SOME
See Also:
Constant Field Values

EXCEPTION_THROW_MINIMUM

public static final int EXCEPTION_THROW_MINIMUM
See Also:
Constant Field Values
Constructor Detail

Source

public Source(String sourceName)
Creates a new Source.

Parameters:
sourceName - name of the new source
See Also:
Source(DataTypeIdentity)

Source

public Source(DataTypeIdentity identity)
Creates a new Source with full identity.

Parameters:
identity - identity of the Source
See Also:
Source(String)
Method Detail

getSourceName

public String getSourceName()
Gets name of the Source.

Returns:
source name

getIdentity

public DataTypeIdentity getIdentity()
Get the identity of this source.

Returns:

isUIEnabled

public boolean isUIEnabled()
Is the Source's user interface enabled?

Returns:
true if the Source's UI is enabled; false otherwise.
See Also:
setUIEnabled(boolean)

setUIEnabled

public void setUIEnabled(boolean enableUI)
Turns on/off the Source's user interface.

Parameters:
enableUI -
See Also:
isUIEnabled()

open

public void open()
          throws JTwainException
Opens this data source. The state of TWAIN will be at [4] Source Open after this operation.

Throws:
JTwainException
See Also:
close()

getState

public int getState()
             throws JTwainException
Gets the state of the source.

Returns:
the state of the source. Possible values:
  • 1 - Pre-Session
  • 2 - Source Manager Loaded
  • 3 - Source Manager Open
  • 4 - Source Open
  • 5 - Source Enabled
  • 6 - Transfer Ready
  • 7 - Transferring
Throws:
JTwainException

getNumberOfPendingImages

public int getNumberOfPendingImages()
                             throws JTwainException
Gets number of pending images.

Returns:
0 if no more pending images; -1 if there are pending images, however, the number of images is unknown; postive integer n there are n pending images
Throws:
JTwainException
See Also:
hasMoreImages()

hasMoreImages

public boolean hasMoreImages()
                      throws JTwainException
Tests whether there are pending images to be acquired.

Returns:
true if there are pending images; false otherwise.
Throws:
JTwainException
See Also:
getNumberOfPendingImages()

close

public void close()
           throws JTwainException
Closes the Source. The state of TWAIN will be at [3] Source Manager Open after this operation.

Throws:
JTwainException
See Also:
open()

acquireImageAsBufferedImage

public BufferedImage acquireImageAsBufferedImage()
                                          throws JTwainException
Acquires an image and returns it as a BufferedImage. The Source Manager will be loaded and opened automatically if it has not been loaded and opened yet; the Source will be opened and enabled if it has not been opened and enabled. Transfer starts immediately.

Returns:
the acquired image
Throws:
JTwainException - if exception or error occurs during the acquirement
See Also:
getState(), acquireImage()

acquireImage

public Image acquireImage()
                   throws JTwainException
Acquires an image. The Source Manager will be loaded and opened automatically if it has not been loaded and opened yet; the Source will be opened and enabled if it has not been opened and enabled. Transfer starts immediately.

Returns:
the acquired image
Throws:
JTwainException - if exception or error occurs during the acquirement
See Also:
getState()

getLastAcquiredImage

public Image getLastAcquiredImage()
Gets the last acquired image.

Returns:
last acquired image or null if not available.
See Also:
acquireImage()

outputLastAcquiredImageAsJPEG

public InputStream outputLastAcquiredImageAsJPEG()
                                          throws IOException
Returns the last acquired image in the JPEG format as a stream. Close the stream after use.

Returns:
Throws:
IOException

saveLastAcquiredImageIntoTemporaryFile

public File saveLastAcquiredImageIntoTemporaryFile()
                                            throws IOException
Saves the last acquired image as JPEG into a temporary file.

Returns:
the temporary file written.
Throws:
IOException

saveLastAcquiredImageIntoFile

public void saveLastAcquiredImageIntoFile(String destination)
                                   throws IOException
Saves the last acquired image as JPEG into the given file.

Returns:
Throws:
IOException

saveLastAcquiredImageIntoFile

public void saveLastAcquiredImageIntoFile(File destination)
                                   throws IOException
Saves the last acquired image as JPEG into the given file.

Returns:
Throws:
IOException

setMinimumExceptionEnabled

public void setMinimumExceptionEnabled(boolean enableMinimumException)
Allows only minimum set of exceptions to be thrown. By default, minimum exception is enabled. If set to true, then most of InvalidStateException, OperationException exceptions will not be thrown.

Parameters:
enableMinimumException -

getMinimumExceptionEnabled

public boolean getMinimumExceptionEnabled()
Gets the status of level of exception thrown.

Returns:
true if minimum exception has been turn on; false otherwise.

toString

public String toString()
String representation of the Source.

Returns:
a String representing the Source
See Also:
toString(boolean)

toString

public String toString(boolean verbose)
String representation of the Source.

Parameters:
verbose - if set to true, use verbose mode; if set to false, use concise mode.
Returns:
a String representing the Source
See Also:
toString()

setRegion

public void setRegion(double left,
                      double top,
                      double right,
                      double bottom)
               throws OperationException
Sets the scanning region for next scan. Use getPhyscialWidth() and getPhyscialHeight() to determine the physical area.

Parameters:
left -
top -
right -
bottom -
Throws:
OperationException

getRegion

public DataTypeImageLayout getRegion()
                              throws OperationException
Returns the scanning region for next scan. Use System.out.println(source.getRegion()) to print out info.

Returns:
Throws:
OperationException

getTransferCount

public int getTransferCount()
                     throws InvalidStateException,
                            OperationException
Get the number of images to be transferred in this session.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_XFERCOUNT

Returns:
Number of images to be transferred. Value range: [-1, 2^15]. Common values are:
  • 1: Application wishes to transfer only one image this session
  • -1: Application is willing to transfer multiple images
Throws:
InvalidStateException
OperationException

getCurrentTransferCount

public int getCurrentTransferCount()
                            throws InvalidStateException,
                                   OperationException
Get the number of images to be transferred in this session [Current value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> CAP_XFERCOUNT

Returns:
Number of images to be transferred. Value range: [-1, 2^15]. Common values are:
  • 1: Application wishes to transfer only one image this session
  • -1: Application is willing to transfer multiple images
Throws:
InvalidStateException
OperationException

getDefaultTransferCount

public int getDefaultTransferCount()
                            throws InvalidStateException,
                                   OperationException
Get the number of images to be transferred in this session [Default value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> CAP_XFERCOUNT

Returns:
Number of images to be transferred. Value range: [-1, 2^15]. Common values are:
  • 1: Application wishes to transfer only one image this session
  • -1: Application is willing to transfer multiple images
Throws:
InvalidStateException
OperationException

resetTransferCount

public int resetTransferCount()
                       throws InvalidStateException,
                              OperationException
Reset the number of images to be transferred in this session.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> CAP_XFERCOUNT

Returns:
Number of images to be transferred. Value range: [-1, 2^15]. Common values are:
  • 1: Application wishes to transfer only one image this session
  • -1: Application is willing to transfer multiple images
Throws:
InvalidStateException
OperationException

setTransferCount

public void setTransferCount(int count)
                      throws InvalidStateException,
                             OperationException
Set the number of images to be transferred in this session.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_XFERCOUNT

Parameters:
count - the number images to be transferred Common values are:
  • 1: Application wishes to transfer only one image this session
  • -1: Application is willing to transfer multiple images
Throws:
InvalidStateException
OperationException

getSupportedCapabilities

public int[] getSupportedCapabilities()
                               throws InvalidStateException,
                                      OperationException
Get a list of all supported capabilities. Note that this does not indicate which capabilities the Source will allow to be set by the application. Some capabilities can only be set if certain setup work has been done so the Source cannot globally answer which capabilities are "set-able".

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_SUPPORTEDCAPS

Returns:
List of capabilities. The codes of capbailities form an int[].
Throws:
InvalidStateException
OperationException

getSupportedCapabilitiesStrings

public String[] getSupportedCapabilitiesStrings()
                                         throws InvalidStateException,
                                                OperationException
Get a human readable list of all supported capabilities. Note that this does not indicate which capabilities the Source will allow to be set by the application. Some capabilities can only be set if certain setup work has been done so the Source cannot globally answer which capabilities are "set-able".

Returns:
List of capabilities. The names of capbailities form a String[].
Throws:
InvalidStateException
OperationException

getUIControllable

public boolean getUIControllable()
                          throws InvalidStateException,
                                 OperationException
Check whether the source supports acquisition with the UI disabled.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_UICONTROLLABLE

Returns:
true if the source supports acquisition with the UI disabled; false if the source can only support acquisition with the UI enabled.
Throws:
InvalidStateException
OperationException

getCompression

public int[] getCompression()
                     throws InvalidStateException,
                            OperationException
Common compression schemes shared by both the source and the application for Buffered Memory and File Transfer.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_COMPRESSION

Returns:
list of compression schemes in common. Possible values:
  • TWCP_NONE
  • TWCP_PACKBITS
  • TWCP_GROUP31D
  • TWCP_GROUP31DEOL
  • TWCP_GROUP32D
  • TWCP_GROUP4
  • TWCP_JPEG TWCP_LZW
  • TWCP_JBIG
  • TWCP_PNG
  • TWCP_RLE4 TWCP_RLE8
  • TWCP_BITFIELDS
Throws:
InvalidStateException
OperationException

getCurrentCompression

public int getCurrentCompression()
                          throws InvalidStateException,
                                 OperationException
Get current common compression schemes shared by both the source and the application for Buffered Memory and File Transfer [Current value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_COMPRESSION

Returns:
current compression scheme Possible values:
  • TWCP_NONE
  • TWCP_PACKBITS
  • TWCP_GROUP31D
  • TWCP_GROUP31DEOL
  • TWCP_GROUP32D
  • TWCP_GROUP4
  • TWCP_JPEG TWCP_LZW
  • TWCP_JBIG
  • TWCP_PNG
  • TWCP_RLE4 TWCP_RLE8
  • TWCP_BITFIELDS
Throws:
InvalidStateException
OperationException

getDefaultCompression

public int getDefaultCompression()
                          throws InvalidStateException,
                                 OperationException
Get default common compression scheme shared by both the source and the application for Buffered Memory and File Transfer [Default value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_COMPRESSION

Returns:
The default compression scheme in common. Possible values:
  • TWCP_NONE
  • TWCP_PACKBITS
  • TWCP_GROUP31D
  • TWCP_GROUP31DEOL
  • TWCP_GROUP32D
  • TWCP_GROUP4
  • TWCP_JPEG TWCP_LZW
  • TWCP_JBIG
  • TWCP_PNG
  • TWCP_RLE4 TWCP_RLE8
  • TWCP_BITFIELDS
Throws:
InvalidStateException
OperationException

setCompression

public void setCompression(int compression)
                    throws InvalidStateException,
                           OperationException
Sets the compression [Not all compressions may be supported by the device!].

Parameters:
compression -
Throws:
InvalidStateException
OperationException

getPlanarChunky

public int[] getPlanarChunky()
                      throws InvalidStateException,
                             OperationException
Get all available color data formats.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_PLANARCHUNKY

Returns:
all available color data formats. Possible values:
  • TWPC_CHUNKY 0
  • TWPC_PLANAR 1
Throws:
InvalidStateException
OperationException

getCurrentPlanarChunky

public int getCurrentPlanarChunky()
                           throws InvalidStateException,
                                  OperationException
Get current color data format [Current value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_PLANARCHUNKY

Returns:
the current color data format. Possible values:
  • TWPC_CHUNKY 0
  • TWPC_PLANAR 1
Throws:
InvalidStateException
OperationException

getDefaultPlanarChunky

public int getDefaultPlanarChunky()
                           throws InvalidStateException,
                                  OperationException
Get the default color format [Default value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_PLANARCHUNKY

Returns:
the default color data format. Possible values:
  • TWPC_CHUNKY 0
  • TWPC_PLANAR 1
Throws:
InvalidStateException
OperationException

getPhysicalHeight

public double getPhysicalHeight()
                         throws InvalidStateException,
                                OperationException
Get the maximum physical height (Y-axis) the source can acquire measured in the unit of ICAP_UNITS.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_PHYSICALHEIGHT

Returns:
max physical height. Value range: [0, 65535].
Throws:
InvalidStateException
OperationException
See Also:
getUnits(), getPhyscialWidth()

getCurrentPhysicalHeight

public double getCurrentPhysicalHeight()
                                throws InvalidStateException,
                                       OperationException
Get the maximum physical height (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Current value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_PHYSICALHEIGHT

Returns:
max physical height. Value range: [0, 65535].
Throws:
InvalidStateException
OperationException
See Also:
getUnits(), getCurrentPhyscialWidth()()

getDefaultPhysicalHeight

public double getDefaultPhysicalHeight()
                                throws InvalidStateException,
                                       OperationException
Get the maximum physical height (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Default value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_PHYSICALHEIGHT

Returns:
max physical height. Value range: [0, 65535].
Throws:
InvalidStateException
OperationException
See Also:
getUnits(), getDefaultPhyscialWidth()()

getPhyscialWidth

public double getPhyscialWidth()
                        throws InvalidStateException,
                               OperationException
Get the maximum physical width (Y-axis) the source can acquire measured in the unit of ICAP_UNITS.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_PHYSICALWIDTH

Returns:
max physical width. Value range: [0, 65535].
Throws:
InvalidStateException
OperationException
See Also:
getUnits(), getPhysicalHeight()

getCurrentPhyscialWidth

public double getCurrentPhyscialWidth()
                               throws InvalidStateException,
                                      OperationException
Get the maximum physical width (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Current value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_PHYSICALWIDTH

Returns:
max physical width. Value range: [0, 65535].
Throws:
InvalidStateException
OperationException
See Also:
getUnits(), getCurrentPhysicalHeight()

getDefaultPhyscialWidth

public double getDefaultPhyscialWidth()
                               throws InvalidStateException,
                                      OperationException
Get the maximum physical width (Y-axis) the source can acquire measured in the unit of ICAP_UNITS [Default value].

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_PHYSICALWIDTH

Returns:
max physical width. Value range: [0, 65535].
Throws:
InvalidStateException
OperationException
See Also:
getDefaultPhysicalHeight()

getPixelFlavor

public int[] getPixelFlavor()
                     throws InvalidStateException,
                            OperationException
Get the pixel flavors - sense of the pixel whose numeric value is zero.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_PIXELFLAVOR

Returns:
Pixel flavors. Possible values:
  • TWPF_CHOCOLATE 0
  • TWPF_VANILLA 1
Throws:
InvalidStateException
OperationException

getCurrentPixelFlavor

public int getCurrentPixelFlavor()
                          throws InvalidStateException,
                                 OperationException
Get the current pixel flavor - sense of the pixel whose numeric value is zero.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_PIXELFLAVOR

Returns:
Pixel flavors. Possible values:
  • TWPF_CHOCOLATE 0
  • TWPF_VANILLA 1
Throws:
InvalidStateException
OperationException

getDefaulttPixelFlavor

public int getDefaulttPixelFlavor()
                           throws InvalidStateException,
                                  OperationException
Get the default pixel flavor - sense of the pixel whose numeric value is zero.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_PIXELFLAVOR

Returns:
Pixel flavors. Possible values:
  • TWPF_CHOCOLATE 0
  • TWPF_VANILLA 1
Throws:
InvalidStateException
OperationException

getBitDepth

public int[] getBitDepth()
                  throws InvalidStateException,
                         OperationException
Get the bit depth values of ICAP_PIXELTYPE. This depth applies to all the data channels (for instance, the R, G, and B channels will all have this same bit depth for RGB data).

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_BITDEPTH

Returns:
bit depth values. Each value: >= 1
Throws:
InvalidStateException
OperationException

getCurrentBitDepth

public int getCurrentBitDepth()
                       throws InvalidStateException,
                              OperationException
Get the current bit depth value of ICAP_PIXELTYPE. This depth applies to all the data channels (for instance, the R, G, and B channels will all have this same bit depth for RGB data).

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_BITDEPTH

Returns:
current bit depth. Value: >= 1
Throws:
InvalidStateException
OperationException

getDefaultBitDepth

public int getDefaultBitDepth()
                       throws InvalidStateException,
                              OperationException
Get the default bit depth value of ICAP_PIXELTYPE. This depth applies to all the data channels (for instance, the R, G, and B channels will all have this same bit depth for RGB data).

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_BITDEPTH

Returns:
the default bit depth. Value: >= 1
Throws:
InvalidStateException
OperationException

resetBitDepth

public void resetBitDepth()
                   throws InvalidStateException,
                          OperationException
Reset the bit depth value of ICAP_PIXELTYPE. This depth applies to all the data channels (for instance, the R, G, and B channels will all have this same bit depth for RGB data).

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_BITDEPTH

Throws:
InvalidStateException
OperationException

setBitDepth

public void setBitDepth(int bitDepth)
                 throws InvalidStateException,
                        OperationException
Set the bit depth value of ICAP_PIXELTYPE. This depth applies to all the data channels (for instance, the R, G, and B channels will all have this same bit depth for RGB data).

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_BITDEPTH

Parameters:
bitDepth - the bit depth value to be set to
Throws:
InvalidStateException
OperationException

getBitOrder

public int[] getBitOrder()
                  throws InvalidStateException,
                         OperationException
Get the bit orders (how the bytes in an image are filled by the Source).

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_BITORDER

Returns:
bit orders. Possible values:
  • TWBO_LSBFIRST 0
  • TWBO_MSBFIRST 1 - Default
Throws:
InvalidStateException
OperationException

getCurrentBitOrder

public int getCurrentBitOrder()
                       throws InvalidStateException,
                              OperationException
Get the current bit orders (how the bytes in an image are filled by the Source).

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_BITORDER

Returns:
the current bit order. Possible values:
  • TWBO_LSBFIRST 0
  • TWBO_MSBFIRST 1 - Default
Throws:
InvalidStateException
OperationException

getDefaultBitOrder

public int getDefaultBitOrder()
                       throws InvalidStateException,
                              OperationException
Get the default bit orders (how the bytes in an image are filled by the Source).

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_BITORDER

Returns:
the default bit order. Possible values:
  • TWBO_LSBFIRST 0
  • TWBO_MSBFIRST 1 - Default
Throws:
InvalidStateException
OperationException

resetBitOrder

public void resetBitOrder()
                   throws InvalidStateException,
                          OperationException
Reset the current bit orders (how the bytes in an image are filled by the Source).

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_BITORDER

Throws:
InvalidStateException
OperationException

setBitOrder

public void setBitOrder(int bitOrder)
                 throws InvalidStateException,
                        OperationException
Set the current bit orders (how the bytes in an image are filled by the Source).

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_BITORDER

Parameters:
bitOrder - the bit order to be set. Possible values:
  • TWBO_LSBFIRST 0
  • TWBO_MSBFIRST 1 - Default
Throws:
InvalidStateException
OperationException

getPixelType

public int[] getPixelType()
                   throws InvalidStateException,
                          OperationException
Get types of pixel data that a source is capable of acquiring.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_PIXELTYPE

Returns:
a list of supported pixel types. Possible values:
  • TWPT_BW 0
  • TWPT_GRAY 1
  • TWPT_RGB 2
  • TWPT_PALETTE 3
  • TWPT_CMY 4
  • TWPT_CMYK 5
  • TWPT_YUV 6
  • TWPT_YUVK 7
  • TWPT_CIEXYZ 8
Throws:
InvalidStateException
OperationException

getCurrentPixelType

public int getCurrentPixelType()
                        throws InvalidStateException,
                               OperationException
Get current type of pixel data that a source is capable of acquiring.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_PIXELTYPE

Returns:
current pixel type. Possible values:
  • TWPT_BW 0
  • TWPT_GRAY 1
  • TWPT_RGB 2
  • TWPT_PALETTE 3
  • TWPT_CMY 4
  • TWPT_CMYK 5
  • TWPT_YUV 6
  • TWPT_YUVK 7
  • TWPT_CIEXYZ 8
Throws:
InvalidStateException
OperationException

getDefaultPixelType

public int getDefaultPixelType()
                        throws InvalidStateException,
                               OperationException
Get default type of pixel data that a source is capable of acquiring.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_PIXELTYPE

Returns:
default pixel type. Possible values:
  • TWPT_BW 0
  • TWPT_GRAY 1
  • TWPT_RGB 2
  • TWPT_PALETTE 3
  • TWPT_CMY 4
  • TWPT_CMYK 5
  • TWPT_YUV 6
  • TWPT_YUVK 7
  • TWPT_CIEXYZ 8
Throws:
InvalidStateException
OperationException

resetPixelType

public void resetPixelType()
                    throws InvalidStateException,
                           OperationException
Reset the type of pixel data that a source is capable of acquiring.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_PIXELTYPE

Throws:
InvalidStateException
OperationException

setPixelType

public void setPixelType(int pixelType)
                  throws InvalidStateException,
                         OperationException
Set the type of pixel data that a source is capable of acquiring.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_PIXELTYPE

Parameters:
pixelType - the pixel type to be set. Possible values:
  • TWPT_BW 0
  • TWPT_GRAY 1
  • TWPT_RGB 2
  • TWPT_PALETTE 3
  • TWPT_CMY 4
  • TWPT_CMYK 5
  • TWPT_YUV 6
  • TWPT_YUVK 7
  • TWPT_CIEXYZ 8
Throws:
InvalidStateException
OperationException

getUnits

public int[] getUnits()
               throws InvalidStateException,
                      OperationException
Get the units of measure for all quantities.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_UNITS

Returns:
supported units. Possible values:
  • TWUN_INCHES 0 - default
  • TWUN_CENTIMETERS 1
  • TWUN_PICAS 2
  • TWUN_POINTS 3
  • TWUN_TWIPS 4
  • TWUN_PIXELS 5
Throws:
InvalidStateException
OperationException

getCurrentUnits

public int[] getCurrentUnits()
                      throws InvalidStateException,
                             OperationException
Get the current unit of measure for all quantities.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_UNITS

Returns:
current unit. Possible values:
  • TWUN_INCHES 0 - default
  • TWUN_CENTIMETERS 1
  • TWUN_PICAS 2
  • TWUN_POINTS 3
  • TWUN_TWIPS 4
  • TWUN_PIXELS 5
Throws:
InvalidStateException
OperationException

getDefaultUnits

public int[] getDefaultUnits()
                      throws InvalidStateException,
                             OperationException
Get the default unit of measure for all quantities.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_UNITS

Returns:
default unit. Possible values:
  • TWUN_INCHES 0 - default
  • TWUN_CENTIMETERS 1
  • TWUN_PICAS 2
  • TWUN_POINTS 3
  • TWUN_TWIPS 4
  • TWUN_PIXELS 5
Throws:
InvalidStateException
OperationException

resetUnits

public void resetUnits()
                throws InvalidStateException,
                       OperationException
Reset the unit of measure for all quantities.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_UNITS

Throws:
InvalidStateException
OperationException

setUnits

public void setUnits(int unitCode)
              throws InvalidStateException,
                     OperationException
Set the unit of measure for all quantities.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_UNITS

Parameters:
unitCode - the unit to be set. Possible values:
  • TWUN_INCHES 0
  • TWUN_CENTIMETERS 1
  • TWUN_PICAS 2
  • TWUN_POINTS 3
  • TWUN_TWIPS 4
  • TWUN_PIXELS 5
Throws:
InvalidStateException
OperationException

getTransferMechanism

public int[] getTransferMechanism()
                           throws InvalidStateException,
                                  OperationException
Get transfer mechanisms supported by both the application and the source.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_XFERMECH

Returns:
transfer mechanisms supported. Possible values:
  • TWSX_NATIVE 0 - default
  • TWSX_FILE 1
  • TWSX_MEMORY 2
  • TWSX_FILE2 3
Throws:
InvalidStateException
OperationException

getCurrentTransferMechanism

public int getCurrentTransferMechanism()
                                throws InvalidStateException,
                                       OperationException
Get the current transfer mechanism.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_XFERMECH

Returns:
current transfer mechanism. Possible values:
  • TWSX_NATIVE 0
  • TWSX_FILE 1
  • TWSX_MEMORY 2
  • TWSX_FILE2 3
Throws:
InvalidStateException
OperationException

getDefaultTransferMechanism

public int getDefaultTransferMechanism()
                                throws InvalidStateException,
                                       OperationException
Get the default transfer mechanism.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_XFERMECH

Returns:
default transfer mechanism. Possible values:
  • TWSX_NATIVE 0
  • TWSX_FILE 1
  • TWSX_MEMORY 2
  • TWSX_FILE2 3
Throws:
InvalidStateException
OperationException

resetTransferMechanism

public void resetTransferMechanism()
                            throws InvalidStateException,
                                   OperationException
Reset the transfer mechanism.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_XFERMECH

Throws:
InvalidStateException
OperationException

setTransferMechanims

public void setTransferMechanims(int transferMechanism)
                          throws InvalidStateException,
                                 OperationException
Set the default transfer mechanism.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_XFERMECH

Parameters:
transferMechanism - the transfer mechanism to be set. Possible values:
  • TWSX_NATIVE 0
  • TWSX_FILE 1
  • TWSX_MEMORY 2
  • TWSX_FILE2 3
Throws:
InvalidStateException
OperationException

getXResolution

public double[] getXResolution()
                        throws InvalidStateException,
                               OperationException
Get all the X-axis resolutions that the source can provide, measured in ICAP_UNITS.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_XRESOLUTION

Returns:
X-axis resolutions
Throws:
InvalidStateException
OperationException
See Also:
getYResolution()

getCurrentXResolution

public double getCurrentXResolution()
                             throws InvalidStateException,
                                    OperationException
Get the current X-axis resolution, measured in ICAP_UNITS.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_XRESOLUTION

Returns:
current X-axis resolution
Throws:
InvalidStateException
OperationException
See Also:
getCurrentYResolution()

getDefaultXResolution

public double getDefaultXResolution()
                             throws InvalidStateException,
                                    OperationException
Get the default X-axis resolution, measured in ICAP_UNITS.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_XRESOLUTION

Returns:
default X-axis resolution
Throws:
InvalidStateException
OperationException
See Also:
getDefaultYResolution()

resetXResolution

public void resetXResolution()
                      throws InvalidStateException,
                             OperationException
Reset the X-axis resolution.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_XRESOLUTION

Throws:
InvalidStateException
OperationException
See Also:
resetYResolution()

setXResolution

public void setXResolution(double xresolution)
                    throws InvalidStateException,
                           OperationException
Set the X-axis resolution.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_XRESOLUTION

Parameters:
xresolution - the X-axis reolution to be set.
Throws:
InvalidStateException
OperationException
See Also:
setYResolution(double)

getYResolution

public double[] getYResolution()
                        throws InvalidStateException,
                               OperationException
Get all the Y-axis resolutions that the source can provide, measured in ICAP_UNITS.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_YRESOLUTION

Returns:
Y-axis resolutions
Throws:
InvalidStateException
OperationException
See Also:
getXResolution()

getCurrentYResolution

public double getCurrentYResolution()
                             throws InvalidStateException,
                                    OperationException
Get the current Y-axis resolution, measured in ICAP_UNITS.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_YRESOLUTION

Returns:
current Y-axis resolution
Throws:
InvalidStateException
OperationException
See Also:
getCurrentXResolution()

getDefaultYResolution

public double getDefaultYResolution()
                             throws InvalidStateException,
                                    OperationException
Get the default Y-axis resolution, measured in ICAP_UNITS.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_YRESOLUTION

Returns:
default Y-axis resolution
Throws:
InvalidStateException
OperationException
See Also:
getDefaultXResolution()

resetYResolution

public void resetYResolution()
                      throws InvalidStateException,
                             OperationException
Reset the Y-axis resolution.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_YRESOLUTION

Throws:
InvalidStateException
OperationException
See Also:
resetXResolution()

setYResolution

public void setYResolution(double Yresolution)
                    throws InvalidStateException,
                           OperationException
Set the Y-axis resolution.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_YRESOLUTION

Parameters:
Yresolution - the Y-axis reolution to be set.
Throws:
InvalidStateException
OperationException
See Also:
setXResolution(double)

getAutoFeed

public boolean[] getAutoFeed()
                      throws InvalidStateException,
                             OperationException
Get AutoFeed abilities.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_AUTOFEED

Returns:
auto feed abilities. Possible values:
  • true
  • false
Throws:
InvalidStateException
OperationException
See Also:
getClearPage(), getFeederEnabled(), getFeederLoaded(), getFeedPage(), getRewindPage()

getCurrentAutoFeed

public boolean getCurrentAutoFeed()
                           throws InvalidStateException,
                                  OperationException
Get current AutoFeed status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> CAP_AUTOFEED

Returns:
current auto feed status. Possible values:
  • true
  • false
Throws:
InvalidStateException
OperationException

getDefaultAutoFeed

public boolean getDefaultAutoFeed()
                           throws InvalidStateException,
                                  OperationException
Get default AutoFeed status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> CAP_AUTOFEED

Returns:
default auto feed status. Possible values:
  • true
  • false
Throws:
InvalidStateException
OperationException

resetAutoFeed

public void resetAutoFeed()
                   throws InvalidStateException,
                          OperationException
Reset auto feed option.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> CAP_AUTOFEED

Throws:
InvalidStateException
OperationException

setAutoFeed

public void setAutoFeed(boolean autoFeed)
                 throws InvalidStateException,
                        OperationException
Set auto feed option.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_AUTOFEED

Parameters:
autoFeed - turn on or off of auto feed
Throws:
InvalidStateException
OperationException

getFeederEnabled

public boolean getFeederEnabled()
                         throws InvalidStateException,
                                OperationException
Get feeder enabled status.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_FEEDERENABLED

Returns:
feeder enabled status
Throws:
InvalidStateException
OperationException
See Also:
getAutoFeed(), getFeederLoaded(), getFeedPage()

getCurrentFeederEnabled

public boolean getCurrentFeederEnabled()
                                throws InvalidStateException,
                                       OperationException
Get current feeder enabled status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> CAP_FEEDERENABLED

Returns:
current feeder enabled status
Throws:
InvalidStateException
OperationException

getDefaultFeederEnabled

public boolean getDefaultFeederEnabled()
                                throws InvalidStateException,
                                       OperationException
Get default feeder enabled status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> CAP_FEEDERENABLED

Returns:
default feeder enabled status
Throws:
InvalidStateException
OperationException

setFeederEnabled

public void setFeederEnabled(boolean feederEnabled)
                      throws InvalidStateException,
                             OperationException
Set feeder enabled.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_FEEDERENABLED

Parameters:
feederEnabled -
Throws:
InvalidStateException
OperationException

getFeederLoaded

public boolean getFeederLoaded()
                        throws InvalidStateException,
                               OperationException
Get feeder loaded status.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_FEEDERLOADED

Returns:
feeder loaded status
Throws:
InvalidStateException
OperationException
See Also:
getAutoFeed(), getFeederEnabled(), getFeedPage(), getRewindPage()

getCurrentFeederLoaded

public boolean getCurrentFeederLoaded()
                               throws InvalidStateException,
                                      OperationException
Get current feeder loaded status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> CAP_FEEDERLOADED

Returns:
current feeder loaded status
Throws:
InvalidStateException
OperationException

getDefaultFeederLoaded

public boolean getDefaultFeederLoaded()
                               throws InvalidStateException,
                                      OperationException
Get default feeder loaded status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> CAP_FEEDERLOADED

Returns:
default feeder loaded status
Throws:
InvalidStateException
OperationException

getClearPage

public boolean getClearPage()
                     throws InvalidStateException,
                            OperationException
Get clear page status.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_CLEARPAGE

Returns:
true if the source will reject the current page being acquired from and leave the feeder acquire area empty; false otherwise.
Throws:
InvalidStateException
OperationException
See Also:
getAutoFeed(), getFeederEnabled(), getFeederLoaded(), getFeedPage(), getRewindPage()

getCurrentClearPage

public boolean getCurrentClearPage()
                            throws InvalidStateException,
                                   OperationException
Get current clear page status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> CAP_CLEARPAGE

Returns:
true if the source will reject the current page being acquired from and leave the feeder acquire area empty; false otherwise.
Throws:
InvalidStateException
OperationException

getDefaultClearPage

public boolean getDefaultClearPage()
                            throws InvalidStateException,
                                   OperationException
Get default clear page status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> CAP_CLEARPAGE

Returns:
true if the source will reject the current page being acquired from and leave the feeder acquire area empty; false otherwise.
Throws:
InvalidStateException
OperationException

resetClearPage

public void resetClearPage()
                    throws InvalidStateException,
                           OperationException
Reset clear page option.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> CAP_CLEARPAGE

Throws:
InvalidStateException
OperationException

setClearPage

public void setClearPage(boolean clearPage)
                  throws InvalidStateException,
                         OperationException
Set clear page option.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_CLEARPAGE

Parameters:
clearPage - option to be set
Throws:
InvalidStateException
OperationException
See Also:
setFeedPage(boolean)

getRewindPage

public boolean getRewindPage()
                      throws InvalidStateException,
                             OperationException
Get rewind page status.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_REWINDPAGE

Returns:
truethe Source will return the current page to the input side of the document feeder and feed the last page from the output side of the feeder back into the acquisition area. false otherwise.
Throws:
InvalidStateException
OperationException
See Also:
getAutoFeed(), getFeederEnabled(), getFeederLoaded(), getFeedPage()

getCurrentRewindPage

public boolean getCurrentRewindPage()
                             throws InvalidStateException,
                                    OperationException
Get current rewind page status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> CAP_REWINDPAGE

Returns:
truethe Source will return the current page to the input side of the document feeder and feed the last page from the output side of the feeder back into the acquisition area. false otherwise.
Throws:
InvalidStateException
OperationException

getDefaultRewindPage

public boolean getDefaultRewindPage()
                             throws InvalidStateException,
                                    OperationException
Get default rewind page status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> CAP_REWINDPAGE

Returns:
truethe Source will return the current page to the input side of the document feeder and feed the last page from the output side of the feeder back into the acquisition area.
false otherwise.
Throws:
InvalidStateException
OperationException

resetRewindPage

public void resetRewindPage()
                     throws InvalidStateException,
                            OperationException
Reset rewind page option.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> CAP_REWINDPAGE

Throws:
InvalidStateException
OperationException

setRewindPage

public void setRewindPage(boolean rewindPage)
                   throws InvalidStateException,
                          OperationException
Set rewind page option.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_REWINDPAGE

Parameters:
rewindPage - truethe Source will return the current page to the input side of the document feeder and feed the last page from the output side of the feeder back into the acquisition area.
false otherwise.
Throws:
InvalidStateException
OperationException
See Also:
setFeedPage(boolean)

getFeedPage

public boolean getFeedPage()
                    throws InvalidStateException,
                           OperationException
Get feed page status.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_FEEDPAGE

Returns:
truethe Source will eject the current page and advance the next page in the document feeder into the feeder acquire area. false otherwise.
Throws:
InvalidStateException
OperationException
See Also:
getAutoFeed(), getFeederEnabled(), getFeederLoaded(), getRewindPage()

getCurrentFeedPage

public boolean getCurrentFeedPage()
                           throws InvalidStateException,
                                  OperationException
Get current feed page status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> CAP_FEEDPAGE

Returns:
truethe Source will eject the current page and advance the next page in the document feeder into the feeder acquire area. false otherwise.
Throws:
InvalidStateException
OperationException

getDefaultFeedPage

public boolean getDefaultFeedPage()
                           throws InvalidStateException,
                                  OperationException
Get default feed page status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> CAP_FEEDPAGE

Returns:
truethe Source will eject the current page and advance the next page in the document feeder into the feeder acquire area. false otherwise.
Throws:
InvalidStateException
OperationException

resetFeedPage

public void resetFeedPage()
                   throws InvalidStateException,
                          OperationException
Reset feed page option.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> CAP_FEEDPAGE

Throws:
InvalidStateException
OperationException

setFeedPage

public void setFeedPage(boolean feedPage)
                 throws InvalidStateException,
                        OperationException
Set feed page option.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_FEEDPAGE

Parameters:
feedPage - truethe Source will eject the current page and advance the next page in the document feeder into the feeder acquire area. false otherwise.
Throws:
InvalidStateException
OperationException
See Also:
setAutoFeed(boolean), setRewindPage(boolean)

getAlarms

public int[] getAlarms()
                throws InvalidStateException,
                       OperationException
Get available alarms.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_ALARMS

Returns:
list of alarms. Possible values:
  • TWAL_ALARM 0
  • TWAL_FEEDERERROR 1
  • TWAL_FEEDERWARNING 2
  • \ TWAL_BARCODE 3
  • TWAL_DOUBLEFEED 4
  • TWAL_JAM 5
  • TWAL_PATCHCODE 6
  • TWAL_POWER 7
  • TWAL_SKEW 8
Throws:
InvalidStateException
OperationException

setAlarms

public void setAlarms(int[] alarms)
               throws InvalidStateException,
                      OperationException
Set alarms.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_ALARMS

Parameters:
alarms - alarms to be set.
Throws:
InvalidStateException
OperationException

getAlarmVolume

public int[] getAlarmVolume()
                     throws InvalidStateException,
                            OperationException
Get alarm volumes.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_ALARMVOLUME

Returns:
alarm volumes. value range: [0, 100].
Throws:
InvalidStateException
OperationException

getCurrentAlarmVolume

public int getCurrentAlarmVolume()
                          throws InvalidStateException,
                                 OperationException
Get current alarm volume.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> CAP_ALARMVOLUME

Returns:
current alarm volume. value range: [0, 100].
Throws:
InvalidStateException
OperationException

getAutomaticBorderDetection

public boolean getAutomaticBorderDetection()
                                    throws InvalidStateException,
                                           OperationException
Get automatic border detection status.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_AUTOMATICBORDERDETECTION

Returns:
the status
Throws:
InvalidStateException
OperationException

getCurrentAutomaticBorderDetection

public boolean getCurrentAutomaticBorderDetection()
                                           throws InvalidStateException,
                                                  OperationException
Get current automatic border detection status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_AUTOMATICBORDERDETECTION

Returns:
the status
Throws:
InvalidStateException
OperationException

getDefaultAutomaticBorderDetection

public boolean getDefaultAutomaticBorderDetection()
                                           throws InvalidStateException,
                                                  OperationException
Get default automatic border detection status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_AUTOMATICBORDERDETECTION

Returns:
the status
Throws:
InvalidStateException
OperationException

setAutomaticBorderDetection

public void setAutomaticBorderDetection(boolean enabled)
                                 throws InvalidStateException,
                                        OperationException
Set automatic border detection operation.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_AUTOMATICBORDERDETECTION

Parameters:
enabled - true to enable it; false otherwise.
Throws:
InvalidStateException
OperationException

resetAutomaticBorderDetection

public void resetAutomaticBorderDetection()
                                   throws InvalidStateException,
                                          OperationException
Reset automatic border detection operation.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_AUTOMATICBORDERDETECTION

Throws:
InvalidStateException
OperationException

getAutomaticDeskew

public boolean getAutomaticDeskew()
                           throws InvalidStateException,
                                  OperationException
Get automatic deskew status.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_AUTOMATICDESKEW

Returns:
the status
Throws:
InvalidStateException
OperationException

getCurrentAutomaticDeskew

public boolean getCurrentAutomaticDeskew()
                                  throws InvalidStateException,
                                         OperationException
Get current automatic deskew status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_AUTOMATICDESKEW

Returns:
the status
Throws:
InvalidStateException
OperationException

getDefaultAutomaticDeskew

public boolean getDefaultAutomaticDeskew()
                                  throws InvalidStateException,
                                         OperationException
Get default automatic deskew status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_AUTOMATICDESKEW

Returns:
the status
Throws:
InvalidStateException
OperationException

setAutomaticDeskew

public void setAutomaticDeskew(boolean enabled)
                        throws InvalidStateException,
                               OperationException
Set automatic rotate operation.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_AUTOMATICDESKEW

Parameters:
enabled - true to enable it; false otherwise.
Throws:
InvalidStateException
OperationException

resetAutomaticDeskew

public void resetAutomaticDeskew()
                          throws InvalidStateException,
                                 OperationException
Reset automatic rotate operation.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_AUTOMATICDESKEW

Throws:
InvalidStateException
OperationException

getAutomaticRotate

public boolean getAutomaticRotate()
                           throws InvalidStateException,
                                  OperationException
Get automatic rotate status.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_AUTOMATICROTATE

Returns:
the status
Throws:
InvalidStateException
OperationException

getCurrentAutomaticRotate

public boolean getCurrentAutomaticRotate()
                                  throws InvalidStateException,
                                         OperationException
Get current automatic rotate status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_AUTOMATICROTATE

Returns:
the status
Throws:
InvalidStateException
OperationException

getDefaultAutomaticRotate

public boolean getDefaultAutomaticRotate()
                                  throws InvalidStateException,
                                         OperationException
Get default automatic rotate status.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> ICAP_AUTOMATICROTATE

Returns:
the status
Throws:
InvalidStateException
OperationException

setAutomaticRotate

public void setAutomaticRotate(boolean enabled)
                        throws InvalidStateException,
                               OperationException
Set automatic rotate operation.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_AUTOMATICROTATE

Parameters:
enabled - true to enable it; false otherwise.
Throws:
InvalidStateException
OperationException

resetAutomaticRotate

public void resetAutomaticRotate()
                          throws InvalidStateException,
                                 OperationException
Reset automatic rotate operation.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_AUTOMATICROTATE

Throws:
InvalidStateException
OperationException

getFlipRotation

public int getFlipRotation()
                    throws InvalidStateException,
                           OperationException
Get flip rotation option.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_FLIPROTATION

Returns:
flip rotation status. Possible values:
  • TWFR_BOOK 0
  • TWFR_FANFOLD 1
Throws:
InvalidStateException
OperationException

getCurrentFlipRotation

public int getCurrentFlipRotation()
                           throws InvalidStateException,
                                  OperationException
Get current flip rotation option.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_FLIPROTATION

Returns:
flip rotation status. Possible values:
  • TWFR_BOOK 0
  • TWFR_FANFOLD 1
Throws:
InvalidStateException
OperationException

getDefaultFlipRotation

public int getDefaultFlipRotation()
                           throws InvalidStateException,
                                  OperationException
Get default flip rotation option.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_FLIPROTATION

Returns:
flip rotation status. Possible values:
  • TWFR_BOOK 0
  • TWFR_FANFOLD 1
Throws:
InvalidStateException
OperationException

setFlipRotation

public void setFlipRotation(int flipRotation)
                     throws InvalidStateException,
                            OperationException
Set flip rotation option.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_FLIPROTATION

Parameters:
flipRotation - option to be set. Possible values:
  • TWFR_BOOK 0
  • TWFR_FANFOLD 1
Throws:
InvalidStateException
OperationException

resetFlipRotation

public void resetFlipRotation()
                       throws InvalidStateException,
                              OperationException
Reset flip rotation option.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> ICAP_FLIPROTATION

Throws:
InvalidStateException
OperationException

getAutomaticCapture

public int getAutomaticCapture()
                        throws InvalidStateException,
                               OperationException
Get number of images to automatically capture. This does not refer to the number of images to be sent to the Application, use CAP_XFERCOUNT for that.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_AUTOMATICCAPTURE

Returns:
number of images to automatically capture
Throws:
InvalidStateException
OperationException

getCurrentAutomaticCapture

public int getCurrentAutomaticCapture()
                               throws InvalidStateException,
                                      OperationException
Get current number of images to automatically capture. This does not refer to the number of images to be sent to the Application, use CAP_XFERCOUNT for that.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> CAP_AUTOMATICCAPTURE

Returns:
current number of images to automatically capture
Throws:
InvalidStateException
OperationException

getDefaultAutomaticCapture

public int getDefaultAutomaticCapture()
                               throws InvalidStateException,
                                      OperationException
Get default number of images to automatically capture. This does not refer to the number of images to be sent to the Application, use CAP_XFERCOUNT for that.

DG_CONTROL / DAT_CAPABILITY / MSG_GETDEFAULT -> CAP_AUTOMATICCAPTURE

Returns:
number of images to automatically capture
Throws:
InvalidStateException
OperationException

setAutomaticCapture

public void setAutomaticCapture(int numberOfImages)
                         throws InvalidStateException,
                                OperationException
Set number of images to automatically capture. This does not refer to the number of images to be sent to the Application, use CAP_XFERCOUNT for that.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_AUTOMATICCAPTURE

Parameters:
numberOfImages - number of images to automatically capture
Throws:
InvalidStateException
OperationException

resetAutomaticCapture

public void resetAutomaticCapture(int numberOfImages)
                           throws InvalidStateException,
                                  OperationException
Reet number of images to automatically capture. This does not refer to the number of images to be sent to the Application, use CAP_XFERCOUNT for that.

DG_CONTROL / DAT_CAPABILITY / MSG_RESET -> CAP_AUTOMATICCAPTURE

Throws:
InvalidStateException
OperationException

getAutoScan

public boolean getAutoScan()
                    throws InvalidStateException,
                           OperationException
Get status of auto scan. The fundamental assumption behind AutoScan is that the device is able to capture the number of images indicated by the value of CAP_XFERCOUNT without waiting for the Application to request the image transfers. The application should check the TW_PENDINGXFERS.Count, and continue to scan until it becomes 0.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_AUTOSCAN

Returns:
true if AutoScan is on; false otherwise.
Throws:
InvalidStateException
OperationException

setAutoScan

public void setAutoScan(boolean autoScan)
                 throws InvalidStateException,
                        OperationException
Set status of auto scan. The fundamental assumption behind AutoScan is that the device is able to capture the number of images indicated by the value of CAP_XFERCOUNT without waiting for the Application to request the image transfers. The application should check the TW_PENDINGXFERS.Count, and continue to scan until it becomes 0.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_AUTOSCAN

Parameters:
autoScan -
Throws:
InvalidStateException
OperationException

getBarCodeDetectionEnabled

public boolean getBarCodeDetectionEnabled()
                                   throws InvalidStateException,
                                          OperationException
Get status of bar code detection. If the device allows this feature to be turned off, then default to off. If the device does not support disabling this feature, report TRUE and disallow attempts to set FALSE.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_BARCODEDETECTIONENABLED

Returns:
true if bar code detection is on; false otherwise.
Throws:
InvalidStateException
OperationException

setBarCodeDetectionEnabled

public void setBarCodeDetectionEnabled(boolean enableBarCodeDetection)
                                throws InvalidStateException,
                                       OperationException
Set status of bar code detection. If the device allows this feature to be turned off, then default to off. If the device does not support disabling this feature, report TRUE and disallow attempts to set FALSE.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_BARCODEDETECTIONENABLED

Parameters:
enableBarCodeDetection -
Throws:
InvalidStateException
OperationException

getExtendedCapabilities

public int[] getExtendedCapabilities()
                              throws InvalidStateException,
                                     OperationException
Get a list of extended capabilities that can be used in States 5 and 6.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_EXTENDEDCAPS

Returns:
List of extended capabilities. The codes of capbailities form an int[].
Throws:
InvalidStateException
OperationException

getExtendedCapabilitiessStrings

public String[] getExtendedCapabilitiessStrings()
                                         throws InvalidStateException,
                                                OperationException
Get a human readable list of extended capabilities.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_EXTENDEDCAPS

Returns:
List of extended capabilities. The names of capbailities form a String[].
Throws:
InvalidStateException
OperationException

setExtendedCapabilities

public void setExtendedCapabilities(int[] extendedCaps)
                             throws InvalidStateException,
                                    OperationException
Set a list of extended capabilities that can be used in States 5 and 6.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_EXTENDEDCAPS

Parameters:
extendedCaps - List of extended capabilities. The codes of capbailities form an int[].
Throws:
InvalidStateException
OperationException

getGamma

public double getGamma()
                throws InvalidStateException,
                       OperationException
Get gamma correction value for image data.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_GAMMA

Returns:
gamma correction value
Throws:
InvalidStateException
OperationException

setGamma

public void setGamma(double gamma)
              throws InvalidStateException,
                     OperationException
Set gamma correction value for image data.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_GAMMA

Parameters:
gamma -
Throws:
InvalidStateException
OperationException

getDeviceOnline

public boolean getDeviceOnline()
                        throws InvalidStateException,
                               OperationException
Determines if hardware in on and ready. This capability can be issued at any time to determine the availability of the image source hardware.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_DEVICEONLINE

Returns:
true if the physical hardware (e.g., scanner, digital camera, image database, etc.) that represents the image source is attached, powered on, and communicating. false otherwise.
Throws:
InvalidStateException
OperationException

getDeviceDateTime

public String getDeviceDateTime()
                         throws InvalidStateException,
                                OperationException
Get the date and time of a device's clock. Managed in the form "YYYY/MM/DD HH:mm:SS:sss" where YYYY is the year, MM is the numerical month, DD is the numerical day, HH is the hour, mm is the minute, SS is the second, and sss is the millisecond.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_DEVICETIMEDATE

Returns:
A string represent the source's date and time
Throws:
InvalidStateException
OperationException

getAuthor

public String getAuthor()
                 throws InvalidStateException,
                        OperationException
Get author of acquired image (may include a copyright string).

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_AUTHOR

Returns:
author of acquired image (may include a copyright string)
Throws:
InvalidStateException
OperationException

setAuthor

public void setAuthor(String author)
               throws InvalidStateException,
                      OperationException
Set author of acquired image (may include a copyright string).

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_AUTHOR

Parameters:
author - author of acquired image (may include a copyright string)
Throws:
InvalidStateException
OperationException

getCaption

public String getCaption()
                  throws InvalidStateException,
                         OperationException
Get a general note about the acquired image.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_CAPTION

Returns:
a general note about the acquired image
Throws:
InvalidStateException
OperationException

setCaption

public void setCaption(String caption)
                throws InvalidStateException,
                       OperationException
Set a general note about the acquired image.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_CAPTION

Parameters:
caption - a general note about the acquired image
Throws:
InvalidStateException
OperationException

setPrinterString

public void setPrinterString(String string)
                      throws InvalidStateException,
                             OperationException
Sets the string component.

Parameters:
string -
Throws:
InvalidStateException
OperationException

getPrinterString

public String getPrinterString()
                        throws InvalidStateException,
                               OperationException
Returns the printer string.

Returns:
Throws:
OperationException
InvalidStateException

getAutoBright

public boolean getAutoBright()
                      throws InvalidStateException,
                             OperationException
Get status of the source's auto-brightness function.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_AUTOBRIGHT

Returns:
true if the Source's Auto-brightness function (if any) is on; false otherwise.
Throws:
InvalidStateException
OperationException

setAutoBright

public void setAutoBright(boolean enableAutoBright)
                   throws InvalidStateException,
                          OperationException
Turn on or off the source's auto-brightness function.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_AUTOBRIGHT

Parameters:
enableAutoBright -
Throws:
InvalidStateException
OperationException

getIndicators

public boolean getIndicators()
                      throws InvalidStateException,
                             OperationException
Use the Source's progress indicator?

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_INDICATORS

Returns:
true if the Source will display a progress indicator during acquisition and transfer, regardless of whether the Source's user interface is active. false if the progress indicator will be suppressed if the Source's user interface is inactive.
Throws:
InvalidStateException
OperationException

setIndicators

public void setIndicators(boolean useProgressIndicator)
                   throws InvalidStateException,
                          OperationException
Turn on/off the Source's progress indicator.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_INDICATORS

Parameters:
useProgressIndicator - set to true if the Source needs display a progress indicator during acquisition and transfer, regardless of whether the Source's user interface is active; set to false if the progress indicator needs to be suppressed if the Source's user interface is inactive.
Throws:
InvalidStateException
OperationException

getClearBuffers

public int getClearBuffers()
                    throws InvalidStateException,
                           OperationException
Reports the presence of data in the scanner’s buffers.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_CLEARBUFFERS

Throws:
InvalidStateException
OperationException

setClearBuffers

public void setClearBuffers(int option)
                     throws InvalidStateException,
                            OperationException
Clears the buffers?

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_CLEARBUFFERS

Parameters:
option - possible values: TWCB_AUTO causes the Source to automatically clear the buffers when it transitions from state 4 to state 5, or from state 5 to state 4; TWCB_CLEAR causes the Source to immediately clear its buffers. TWCB_NOCLEAR causes the Source to preserve images in the buffers.
Throws:
InvalidStateException
OperationException

getMaxBatchBuffers

public int[] getMaxBatchBuffers()
                         throws InvalidStateException,
                                OperationException
Describes the number of pages that the scanner can buffer when CAP_AUTOSCAN is enabled.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_MAXBATCHBUFFERS

Returns:
the supported values
Throws:
InvalidStateException
OperationException

setMaxBatchBuffers

public void setMaxBatchBuffers(int size)
                        throws InvalidStateException,
                               OperationException
Sets the current number pages to be buffered (if the Source allows this to be set)

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_MAXBATCHBUFFERS

Parameters:
size - number pages to be buffered
Throws:
InvalidStateException
OperationException

getBrightness

public double[] getBrightness()
                       throws InvalidStateException,
                              OperationException
The brightness values available within the Source.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_BRIGHTNESS

Returns:
supported brightness values
Throws:
InvalidStateException
OperationException

setBrightness

public void setBrightness(double[] values)
                   throws InvalidStateException,
                          OperationException
Sets brightness values.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_BRIGHTNESS

Parameters:
values - brightness values
Throws:
InvalidStateException
OperationException

getContrast

public double[] getContrast()
                     throws InvalidStateException,
                            OperationException
The contrast values available within the Source.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_CONTRAST

Returns:
supported contrast values
Throws:
InvalidStateException
OperationException

setContrast

public void setContrast(double[] values)
                 throws InvalidStateException,
                        OperationException
Sets constrast values.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_CONTRAST

Parameters:
values - brightness values
Throws:
InvalidStateException
OperationException

getPrinter

public int[] getPrinter()
                 throws InvalidStateException,
                        OperationException
Returns the current list of printer devices.

Throws:
InvalidStateException
OperationException

setPrinter

public void setPrinter(int printer)
                throws InvalidStateException,
                       OperationException
Selects the current printer.

Parameters:
printer -
Throws:
InvalidStateException
OperationException

getPrinterEnabled

public boolean getPrinterEnabled()
                          throws InvalidStateException,
                                 OperationException
Current printer device on/off?

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_PRINTERENABLED

Returns:
current status - true if on, false otherwise.
Throws:
InvalidStateException
OperationException

setPrinterEnabled

public void setPrinterEnabled(boolean enable)
                       throws InvalidStateException,
                              OperationException
Turns current printer device on/off.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_PRINTERENABLED

Parameters:
enable -
Throws:
InvalidStateException
OperationException

getPrinterMode

public int getPrinterMode()
                   throws InvalidStateException,
                          OperationException
Returns the device mode of the current printer.

Throws:
OperationException
InvalidStateException

getFrames

public double[][] getFrames()
                     throws InvalidStateException,
                            OperationException
Returns the size and location of all the frames the Source will acquire image data from when acquiring from each page.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_FRAMES

Returns:
an array of frames (which are represents by double arrays)
Throws:
InvalidStateException
OperationException

getCurrentFrame

public double[] getCurrentFrame()
                         throws InvalidStateException,
                                OperationException
Returns the size and location of the next frame to be acquired.

DG_CONTROL / DAT_CAPABILITY / MSG_GETCURRENT -> ICAP_FRAMES

Returns:
the next frame to be acquired. Array elements include: left, top, right and bottom - in sequential order.
Throws:
InvalidStateException
OperationException

setFrames

public void setFrames(double[][] multipleFrames)
               throws InvalidStateException,
                      OperationException
Specifies the frames and their locations to be used to acquire from future pages.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_FRAMES

Parameters:
multipleFrames - frames expressed in arrays of double arrays. each frame is represented by a four-element double array: left, top, right and bottom.
Throws:
InvalidStateException
OperationException

setFrames

public void setFrames(double[] singleFrame)
               throws InvalidStateException,
                      OperationException
Specifies the single frame and its location to be used to acquire from future pages.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_FRAMES

Parameters:
singleFrame - the frame is expressed in a double array: left, top, right and bottom.
Throws:
InvalidStateException
OperationException

getMaxFrames

public int getMaxFrames()
                 throws InvalidStateException,
                        OperationException
Gets the maximum number of frames the Source can provide or the application can accept per page. This is a bounding capability only. It does not establish current or future behavior.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_MAXFRAMES

Returns:
the maximum number of frames the Source can provide
Throws:
InvalidStateException
OperationException

setMaxFrames

public void setMaxFrames(int max)
                  throws InvalidStateException,
                         OperationException
Sets the maximum number of frames the Source can provide or the application can accept per page. This is a bounding capability only. It does not establish current or future behavior.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_MAXFRAMES

Parameters:
max - the maximum number of frames the Source can provide
Throws:
InvalidStateException
OperationException

getSupportedSizes

public int[] getSupportedSizes()
                        throws InvalidStateException,
                               OperationException
Gets the size(s) the Source can/should use to acquire image data.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_SUPPORTEDSIZES

Returns:
sizes of fixed frames
Throws:
InvalidStateException
OperationException

setSupportedSizes

public void setSupportedSizes(int[] sizes)
                       throws InvalidStateException,
                              OperationException
Sets the size(s) the Source can/should use to acquire image data.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_SUPPORTEDSIZES

Parameters:
sizes - sizes of fixed frames
Throws:
InvalidStateException
OperationException

getPatchCodeDetectionEnabled

public boolean getPatchCodeDetectionEnabled()
                                     throws InvalidStateException,
                                            OperationException
Gets the status of patch code detection.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> ICAP_PATCHCODEDETECTIONENABLED

Returns:
is patch code detection on?
Throws:
InvalidStateException
OperationException

setPatchCodeDetectionEnabled

public void setPatchCodeDetectionEnabled(boolean enable)
                                  throws InvalidStateException,
                                         OperationException
Turns patch code detection on and off.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> ICAP_PATCHCODEDETECTIONENABLED

Parameters:
enable -
Throws:
InvalidStateException
OperationException

setDuplexEnabled

public void setDuplexEnabled(boolean enable)
                      throws InvalidStateException,
                             OperationException
Enables/Disables duplex.

DG_CONTROL / DAT_CAPABILITY / MSG_SET -> CAP_DUPLEXENABLED

Parameters:
enable - turn on or off of duplex
Throws:
InvalidStateException
OperationException

getDuplexEnabled

public boolean getDuplexEnabled()
                         throws InvalidStateException,
                                OperationException
Get duplex status.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_DUPLEXENABLED

Returns:
duplex enabled status
Throws:
InvalidStateException
OperationException

getDuplex

public int getDuplex()
              throws InvalidStateException,
                     OperationException
Gets the duplex mode supported by the scanner.

DG_CONTROL / DAT_CAPABILITY / MSG_GET -> CAP_DUPLEX

Returns:
the duplex mode supported by the scanner.
Throws:
InvalidStateException
OperationException

getBoolean

public static boolean getBoolean(Object o)
Extract boolean value from an object.

Parameters:
o - an object, perferred of the type Long
Returns:
trueif the object o is instanceof Long and o.intValue != 0; false otherwise.
See Also:
getInt(Object), getDouble(Object)

getBooleanArray

public static boolean[] getBooleanArray(Object o)
Extract a boolean array from an object.

Parameters:
o - an object, perferred of the type Long[] or Long
Returns:
an boolean[] if values have been extracted successfully; null otherwise.
See Also:
getBoolean(Object), getIntArray(Object), getDoubleArray(Object)

getInt

public static int getInt(Object o)
Extract an int from an object.

Parameters:
o - the object, perferred of the type Long
Returns:
Source.INVALID_NUMBER if o is null or not of the type Long; o.intValue() otherwise.
See Also:
getBoolean(Object), getDouble(Object)

getIntArray

public static int[] getIntArray(Object o)
Extract an integer array from an object.

Parameters:
o - the object, perferred of the type Long[] or Long
Returns:
an int[] if values have been extracted successfully; null otherwise.
See Also:
getInt(Object), getBooleanArray(Object), getDoubleArray(Object)

getDouble

public static double getDouble(Object o)
Extract a double from an object.

Parameters:
o - the object, perferred of the type Long
Returns:
Source.INVALID_NUMBER if o is null or not of the type Long; o.intValue() otherwise.
See Also:
getBoolean(Object), #getInt(Object)(Object)

getDoubleArray

public static double[] getDoubleArray(Object o)
Extract a double array from an object.

Parameters:
o - the object, perferred of the type Double[] or Double
Returns:
a double[] if values have been extracted successfully; null otherwise.
See Also:
getDouble(Object), getBooleanArray(Object), getIntArray(Object)

getCapability

public Object getCapability(int mesgType,
                            int capabilityCode,
                            int expectedContainerType)
                     throws InvalidStateException,
                            OperationException
Get a capability. Perform the action: DG_CONTROL / DAT_CAPABILITY / MSG_GET | MSG_GETCURRENT | MSG_GETDEFAULT

Parameters:
mesgType - GET type: valid values: MSG_GET, MSG_GETCURRENT, MSG_GETDEFAULT
capabilityCode - the capability code, eg. CAP_SUPPORTEDCAPS
expectedContainerType - the expected container type. If unkown, or do not care, simply put TWON_DONTCARE16.
Returns:
an object. Some example: if the container is of the type ValueContainerOneValue and item type is TWTY_UINT16, then a Long will be returned; For a single value container, the retuned object may be of the following types: Long, Double, String in case of multi-value containers, the returned object may be of the following type: Long[], Double[], String[].
Throws:
InvalidStateException
OperationException
See Also:
getInt(Object), getDouble(Object), getBoolean(Object), getIntArray(Object), getDoubleArray(Object), getBooleanArray(Object)

resetCapability

public void resetCapability(int capabilityCode)
                     throws InvalidStateException,
                            OperationException
Reset a capability. Perform the action: DG_CONTROL / DAT_CAPABILITY / MSG_RESET

Parameters:
capabilityCode - the capability code
Throws:
InvalidStateException
OperationException

setCapability

public void setCapability(int capabilityCode,
                          ValueContainer container)
                   throws InvalidStateException,
                          OperationException
Set a capability. Perform the action: DG_CONTROL / DAT_CAPABILITY / MSG_SET

Parameters:
capabilityCode - the capability to be set
container - a container containing values to be set
Throws:
InvalidStateException
OperationException

JTwain v9 - Lab Asprise! All Rights Reserved.