using System.Runtime.InteropServices;

/*
    This file is part of the Dynarithmic TWAIN Library (DTWAIN).
    Copyright (c) 2002-2026 Dynarithmic Software.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
    DYNARITHMIC SOFTWARE. DYNARITHMIC SOFTWARE DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
    OF THIRD PARTY RIGHTS.
 */
namespace Dynarithmic
{
    using DTWAIN_SOURCE = System.IntPtr;
    using DTWAIN_ARRAY = System.IntPtr;
    using DTWAIN_RANGE = System.IntPtr;
    using DTWAIN_FRAME = System.IntPtr;
    using DTWAIN_PDFTEXTELEMENT = System.IntPtr;
    using DTWAIN_HANDLE = System.IntPtr;
    using NULL_HANDLE = System.IntPtr;
    using DTWAIN_IDENTITY = System.IntPtr;
    using DTWAIN_OCRENGINE = System.IntPtr;
    using DTWAIN_OCRTEXTINFOHANDLE = System.IntPtr;
    using TW_UINT16 = System.UInt16;
    using TW_UINT32 = System.UInt32;
    using TW_BOOL = System.UInt16;
    using DTWAIN_MEMORY_PTR = System.IntPtr;
    using ULONG64 = System.UInt64;
    using LONG64 = System.Int64;
    using LONGLONG = System.Int64;
    using DWORD = System.UInt32;
    using LONG = System.Int32;
    using HINSTANCE = System.IntPtr;
    using HWND = System.IntPtr;
    using DTWAIN_FLOAT = System.Double;
    using HANDLE = System.IntPtr;
    using HFONT = System.IntPtr;

    public class TwainAPI
    {
        // string type constants
        // these include room for the strings and a null char
        public enum TWSTR : int
        {
            STR32 = 34,
            STR64 = 66,
            STR128 = 130,
            STR255 = 256,
            STR1024 = 1026,
            UNI512 = 512
        }

        [StructLayout(LayoutKind.Sequential, Pack = 2)]
        public struct TW_VERSION
        {
            public TW_UINT16 MajorNum;                          // Major revision number of the software
            public TW_UINT16 MinorNum;                          // Incremental revision number of the software
            public TW_UINT16 Language;                          // e.g. TWLG_SWISSFRENCH
            public TW_UINT16 Country;                           // e.g. TWCY_SWITZERLAND

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)TWSTR.STR32)]
            public string Info;                                 // e.g. "1.0b3 Beta release"
        }

        [StructLayout(LayoutKind.Sequential, Pack = 2)]
        public class TW_IDENTITY
        {
            public TW_UINT32 Id;                                // Unique number.  In Windows, application hWnd
            public TW_VERSION Version;                          // Identifies the piece of code
            public TW_UINT16 ProtocolMajor;                     // Application and DS must set to TWON_PROTOCOLMAJOR
            public TW_UINT16 ProtocolMinor;                     // Application and DS must set to TWON_PROTOCOLMINOR
            public TW_UINT32 SupportedGroups;                   // Bit field OR combination of DG_ constants

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)TWSTR.STR32)]
            public string Manufacturer = string.Empty;                         // Manufacturer name, e.g. "Hewlett-Packard"

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)TWSTR.STR32)]
            public string ProductFamily = string.Empty;                        // Product family name, e.g. "ScanJet"

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)TWSTR.STR32)]
            public string ProductName = string.Empty;                          // Product name, e.g. "ScanJet Plus"
        }

        public struct POINT
        {
            public System.Int32 x;
            public System.Int32 Y;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 8)]
        public struct MSG
        {
            public System.IntPtr hwnd;
            public System.UInt32 message;
            public System.UIntPtr wParam;
            public System.UIntPtr lParam;
            public System.UInt32 time;
            public POINT pt;
        }

        [ StructLayout( LayoutKind.Sequential, CharSet=CharSet.Auto )]
        public class OpenFileName
        {
            public int      structSize = 0;
            public System.IntPtr   dlgOwner = System.IntPtr.Zero;
            public System.IntPtr   instance = System.IntPtr.Zero;
            public string   filter = string.Empty;
            public string   customFilter = string.Empty;
            public int      maxCustFilter = 0;
            public int      filterIndex = 0;
            public string   file = string.Empty;
            public int      maxFile = 0;
            public string   fileTitle = string.Empty;
            public int      maxFileTitle = 0;
            public string   initialDir = string.Empty;
            public string   title = string.Empty;
            public int      flags = 0;
            public short    fileOffset = 0;
            public short    fileExtension = 0;
            public string   defExt = string.Empty;
            public System.IntPtr   custData = System.IntPtr.Zero;
            public System.IntPtr   hook = System.IntPtr.Zero;
            public string templateName = string.Empty;
            public System.IntPtr   reservedPtr = System.IntPtr.Zero;
            public int      reservedInt = 0;
            public int      flagsEx = 0;
        }


        public delegate int  DTwainCallback( int wParam, int lParam, int UserData );
        public delegate int  DTwainCallback64( int wParam, int lParam, long UserData );
        public delegate int  DTwainErrorProc( int param1, int param2 );
        public delegate int  DTwainErrorProc64( int param1, long param2);
        public delegate int  DTwainLoggerProcA([MarshalAs(UnmanagedType.LPStr)] string lpszName, long UserData);
        public delegate int  DTwainLoggerProcW([MarshalAs(UnmanagedType.LPWStr)] string lpszName, long UserData);
        public delegate DTWAIN_HANDLE DTwainDIBUpdateProc(DTWAIN_SOURCE source, int currentImage, DTWAIN_HANDLE DibData);
        public delegate int  DTwainLoggerProc([MarshalAs(UnmanagedType.LPTStr)] string lpszName, long UserData);

        public const int DTWAIN_FF_TIFF = 0;
        public const int DTWAIN_FF_PICT = 1;
        public const int DTWAIN_FF_BMP = 2;
        public const int DTWAIN_FF_XBM = 3;
        public const int DTWAIN_FF_JFIF = 4;
        public const int DTWAIN_FF_FPX = 5;
        public const int DTWAIN_FF_TIFFMULTI = 6;
        public const int DTWAIN_FF_PNG = 7;
        public const int DTWAIN_FF_SPIFF = 8;
        public const int DTWAIN_FF_EXIF = 9;
        public const int DTWAIN_FF_PDF = 10;
        public const int DTWAIN_FF_JP2 = 11;
        public const int DTWAIN_FF_JPX = 13;
        public const int DTWAIN_FF_DEJAVU = 14;
        public const int DTWAIN_FF_PDFA = 15;
        public const int DTWAIN_FF_PDFA2 = 16;
        public const int DTWAIN_FF_PDFRASTER = 17;
        public const int DTWAIN_CP_NONE = 0;
        public const int DTWAIN_CP_PACKBITS = 1;
        public const int DTWAIN_CP_GROUP31D = 2;
        public const int DTWAIN_CP_GROUP31DEOL = 3;
        public const int DTWAIN_CP_GROUP32D = 4;
        public const int DTWAIN_CP_GROUP4 = 5;
        public const int DTWAIN_CP_JPEG = 6;
        public const int DTWAIN_CP_LZW = 7;
        public const int DTWAIN_CP_JBIG = 8;
        public const int DTWAIN_CP_PNG = 9;
        public const int DTWAIN_CP_RLE4 = 10;
        public const int DTWAIN_CP_RLE8 = 11;
        public const int DTWAIN_CP_BITFIELDS = 12;
        public const int DTWAIN_CP_ZIP = 13;
        public const int DTWAIN_CP_JPEG2000 = 14;
        public const int DTWAIN_FS_NONE = 0;
        public const int DTWAIN_FS_A4LETTER = 1;
        public const int DTWAIN_FS_B5LETTER = 2;
        public const int DTWAIN_FS_USLETTER = 3;
        public const int DTWAIN_FS_USLEGAL = 4;
        public const int DTWAIN_FS_A5 = 5;
        public const int DTWAIN_FS_B4 = 6;
        public const int DTWAIN_FS_B6 = 7;
        public const int DTWAIN_FS_USLEDGER = 9;
        public const int DTWAIN_FS_USEXECUTIVE = 10;
        public const int DTWAIN_FS_A3 = 11;
        public const int DTWAIN_FS_B3 = 12;
        public const int DTWAIN_FS_A6 = 13;
        public const int DTWAIN_FS_C4 = 14;
        public const int DTWAIN_FS_C5 = 15;
        public const int DTWAIN_FS_C6 = 16;
        public const int DTWAIN_FS_4A0 = 17;
        public const int DTWAIN_FS_2A0 = 18;
        public const int DTWAIN_FS_A0 = 19;
        public const int DTWAIN_FS_A1 = 20;
        public const int DTWAIN_FS_A2 = 21;
        public const int DTWAIN_FS_A4 = DTWAIN_FS_A4LETTER;
        public const int DTWAIN_FS_A7 = 22;
        public const int DTWAIN_FS_A8 = 23;
        public const int DTWAIN_FS_A9 = 24;
        public const int DTWAIN_FS_A10 = 25;
        public const int DTWAIN_FS_ISOB0 = 26;
        public const int DTWAIN_FS_ISOB1 = 27;
        public const int DTWAIN_FS_ISOB2 = 28;
        public const int DTWAIN_FS_ISOB3 = DTWAIN_FS_B3;
        public const int DTWAIN_FS_ISOB4 = DTWAIN_FS_B4;
        public const int DTWAIN_FS_ISOB5 = 29;
        public const int DTWAIN_FS_ISOB6 = DTWAIN_FS_B6;
        public const int DTWAIN_FS_ISOB7 = 30;
        public const int DTWAIN_FS_ISOB8 = 31;
        public const int DTWAIN_FS_ISOB9 = 32;
        public const int DTWAIN_FS_ISOB10 = 33;
        public const int DTWAIN_FS_JISB0 = 34;
        public const int DTWAIN_FS_JISB1 = 35;
        public const int DTWAIN_FS_JISB2 = 36;
        public const int DTWAIN_FS_JISB3 = 37;
        public const int DTWAIN_FS_JISB4 = 38;
        public const int DTWAIN_FS_JISB5 = DTWAIN_FS_B5LETTER;
        public const int DTWAIN_FS_JISB6 = 39;
        public const int DTWAIN_FS_JISB7 = 40;
        public const int DTWAIN_FS_JISB8 = 41;
        public const int DTWAIN_FS_JISB9 = 42;
        public const int DTWAIN_FS_JISB10 = 43;
        public const int DTWAIN_FS_C0 = 44;
        public const int DTWAIN_FS_C1 = 45;
        public const int DTWAIN_FS_C2 = 46;
        public const int DTWAIN_FS_C3 = 47;
        public const int DTWAIN_FS_C7 = 48;
        public const int DTWAIN_FS_C8 = 49;
        public const int DTWAIN_FS_C9 = 50;
        public const int DTWAIN_FS_C10 = 51;
        public const int DTWAIN_FS_USSTATEMENT = 52;
        public const int DTWAIN_FS_BUSINESSCARD = 53;
        public const int DTWAIN_ANYSUPPORT = (-1);
        public const int DTWAIN_BMP = 100;
        public const int DTWAIN_JPEG = 200;
        public const int DTWAIN_PDF = 250;
        public const int DTWAIN_PDFMULTI = 251;
        public const int DTWAIN_PCX = 300;
        public const int DTWAIN_DCX = 301;
        public const int DTWAIN_TGA = 400;
        public const int DTWAIN_TIFFLZW = 500;
        public const int DTWAIN_TIFFNONE = 600;
        public const int DTWAIN_TIFFG3 = 700;
        public const int DTWAIN_TIFFG4 = 800;
        public const int DTWAIN_TIFFPACKBITS = 801;
        public const int DTWAIN_TIFFDEFLATE = 802;
        public const int DTWAIN_TIFFJPEG = 803;
        public const int DTWAIN_TIFFJBIG = 804;
        public const int DTWAIN_TIFFPIXARLOG = 805;
        public const int DTWAIN_TIFFNONEMULTI = 900;
        public const int DTWAIN_TIFFG3MULTI = 901;
        public const int DTWAIN_TIFFG4MULTI = 902;
        public const int DTWAIN_TIFFPACKBITSMULTI = 903;
        public const int DTWAIN_TIFFDEFLATEMULTI = 904;
        public const int DTWAIN_TIFFJPEGMULTI = 905;
        public const int DTWAIN_TIFFLZWMULTI = 906;
        public const int DTWAIN_TIFFJBIGMULTI = 907;
        public const int DTWAIN_TIFFPIXARLOGMULTI = 908;
        public const int DTWAIN_WMF = 850;
        public const int DTWAIN_EMF = 851;
        public const int DTWAIN_GIF = 950;
        public const int DTWAIN_PNG = 1000;
        public const int DTWAIN_PSD = 2000;
        public const int DTWAIN_JPEG2000 = 3000;
        public const int DTWAIN_POSTSCRIPT1 = 4000;
        public const int DTWAIN_POSTSCRIPT2 = 4001;
        public const int DTWAIN_POSTSCRIPT3 = 4002;
        public const int DTWAIN_POSTSCRIPT1MULTI = 4003;
        public const int DTWAIN_POSTSCRIPT2MULTI = 4004;
        public const int DTWAIN_POSTSCRIPT3MULTI = 4005;
        public const int DTWAIN_TEXT = 6000;
        public const int DTWAIN_TEXTMULTI = 6001;
        public const int DTWAIN_TIFFMULTI = 7000;
        public const int DTWAIN_ICO = 8000;
        public const int DTWAIN_ICO_VISTA = 8001;
        public const int DTWAIN_ICO_RESIZED = 8002;
        public const int DTWAIN_WBMP = 8500;
        public const int DTWAIN_WEBP = 8501;
        public const int DTWAIN_PPM = 10000;
        public const int DTWAIN_WBMP_RESIZED = 11000;
        public const int DTWAIN_TGA_RLE = 11001;
        public const int DTWAIN_BMP_RLE = 11002;
        public const int DTWAIN_BIGTIFFLZW = 11003;
        public const int DTWAIN_BIGTIFFLZWMULTI = 11004;
        public const int DTWAIN_BIGTIFFNONE = 11005;
        public const int DTWAIN_BIGTIFFNONEMULTI = 11006;
        public const int DTWAIN_BIGTIFFPACKBITS = 11007;
        public const int DTWAIN_BIGTIFFPACKBITSMULTI = 11008;
        public const int DTWAIN_BIGTIFFDEFLATE = 11009;
        public const int DTWAIN_BIGTIFFDEFLATEMULTI = 11010;
        public const int DTWAIN_BIGTIFFG3 = 11011;
        public const int DTWAIN_BIGTIFFG3MULTI = 11012;
        public const int DTWAIN_BIGTIFFG4 = 11013;
        public const int DTWAIN_BIGTIFFG4MULTI = 11014;
        public const int DTWAIN_BIGTIFFJPEG = 11015;
        public const int DTWAIN_BIGTIFFJPEGMULTI = 11016;
        public const int DTWAIN_JPEGXR = 12000;
        public const int DTWAIN_SVG = 13000;
        public const int DTWAIN_SVGZ = 13001;
        public const int DTWAIN_INCHES = 0;
        public const int DTWAIN_CENTIMETERS = 1;
        public const int DTWAIN_PICAS = 2;
        public const int DTWAIN_POINTS = 3;
        public const int DTWAIN_TWIPS = 4;
        public const int DTWAIN_PIXELS = 5;
        public const int DTWAIN_MILLIMETERS = 6;
        public const int DTWAIN_USENAME = 16;
        public const int DTWAIN_USEPROMPT = 32;
        public const int DTWAIN_USELONGNAME = 64;
        public const int DTWAIN_USESOURCEMODE = 128;
        public const int DTWAIN_USELIST = 256;
        public const int DTWAIN_CREATE_DIRECTORY = 512;
        public const int DTWAIN_NODELETEDIBS = 1024;
        public const int DTWAIN_CREATEDIRECTORY = DTWAIN_CREATE_DIRECTORY;
        public const int DTWAIN_ARRAYANY = 1;
        public const int DTWAIN_ArrayTypePTR = 1;
        public const int DTWAIN_ARRAYLONG = 2;
        public const int DTWAIN_ARRAYFLOAT = 3;
        public const int DTWAIN_ARRAYHANDLE = 4;
        public const int DTWAIN_ARRAYSOURCE = 5;
        public const int DTWAIN_ARRAYSTRING = 6;
        public const int DTWAIN_ARRAYFRAME = 7;
        public const int DTWAIN_ARRAYBOOL = DTWAIN_ARRAYLONG;
        public const int DTWAIN_ARRAYLONGSTRING = 8;
        public const int DTWAIN_ARRAYUNICODESTRING = 9;
        public const int DTWAIN_ARRAYLONG64 = 10;
        public const int DTWAIN_ARRAYANSISTRING = 11;
        public const int DTWAIN_ARRAYWIDESTRING = 12;
        public const int DTWAIN_ARRAYULONG = 13;
        public const int DTWAIN_ARRAYTWFIX32 = 200;
        public const int DTWAIN_ArrayTypeINVALID = 0;
        public const int DTWAIN_ARRAYINT16 = 100;
        public const int DTWAIN_ARRAYUINT16 = 110;
        public const int DTWAIN_ARRAYUINT32 = 120;
        public const int DTWAIN_ARRAYINT32 = 130;
        public const int DTWAIN_ARRAYINT64 = 140;
        public const int DTWAIN_ARRAYUINT64 = 150;
        public const int DTWAIN_ARRAYSHORTINT16 = 160;
        public const int DTWAIN_ARRAYSHORTUINT16 = 170;
        public const int DTWAIN_RANGELONG = DTWAIN_ARRAYLONG;
        public const int DTWAIN_RANGEFLOAT = DTWAIN_ARRAYFLOAT;
        public const int DTWAIN_RANGEMIN = 0;
        public const int DTWAIN_RANGEMAX = 1;
        public const int DTWAIN_RANGESTEP = 2;
        public const int DTWAIN_RANGEDEFAULT = 3;
        public const int DTWAIN_RANGECURRENT = 4;
        public const int DTWAIN_FRAMELEFT = 0;
        public const int DTWAIN_FRAMETOP = 1;
        public const int DTWAIN_FRAMERIGHT = 2;
        public const int DTWAIN_FRAMEBOTTOM = 3;
        public const int DTWAIN_FIX32WHOLE = 0;
        public const int DTWAIN_FIX32FRAC = 1;
        public const int DTWAIN_JC_NONE = 0;
        public const int DTWAIN_JC_JSIC = 1;
        public const int DTWAIN_JC_JSIS = 2;
        public const int DTWAIN_JC_JSXC = 3;
        public const int DTWAIN_JC_JSXS = 4;
        public const int DTWAIN_CAPDATATYPE_UNKNOWN = (-10);
        public const int DTWAIN_JCBP_JSIC = 5;
        public const int DTWAIN_JCBP_JSIS = 6;
        public const int DTWAIN_JCBP_JSXC = 7;
        public const int DTWAIN_JCBP_JSXS = 8;
        public const int DTWAIN_FEEDPAGEON = 1;
        public const int DTWAIN_CLEARPAGEON = 2;
        public const int DTWAIN_REWINDPAGEON = 4;
        public const int DTWAIN_AppOwnsDib = 1;
        public const int DTWAIN_SourceOwnsDib = 2;
        public const int DTWAIN_CONTARRAY = 8;
        public const int DTWAIN_CONTENUMERATION = 16;
        public const int DTWAIN_CONTONEVALUE = 32;
        public const int DTWAIN_CONTRANGE = 64;
        public const int DTWAIN_CONTDEFAULT = 0;
        public const int DTWAIN_CAPGET = 1;
        public const int DTWAIN_CAPGETCURRENT = 2;
        public const int DTWAIN_CAPGETDEFAULT = 3;
        public const int DTWAIN_CAPSET = 6;
        public const int DTWAIN_CAPRESET = 7;
        public const int DTWAIN_CAPRESETALL = 8;
        public const int DTWAIN_CAPSETAVAILABLE = 8;
        public const int DTWAIN_CAPSETCURRENT = 16;
        public const int DTWAIN_CAPGETHELP = 9;
        public const int DTWAIN_CAPGETLABEL = 10;
        public const int DTWAIN_CAPGETLABELENUM = 11;
        public const int DTWAIN_CAPSETCONSTRAINT = 12;
        public const int DTWAIN_AREASET = DTWAIN_CAPSET;
        public const int DTWAIN_AREARESET = DTWAIN_CAPRESET;
        public const int DTWAIN_AREACURRENT = DTWAIN_CAPGETCURRENT;
        public const int DTWAIN_AREADEFAULT = DTWAIN_CAPGETDEFAULT;
        public const int DTWAIN_VER15 = 0;
        public const int DTWAIN_VER16 = 1;
        public const int DTWAIN_VER17 = 2;
        public const int DTWAIN_VER18 = 3;
        public const int DTWAIN_VER20 = 4;
        public const int DTWAIN_VER21 = 5;
        public const int DTWAIN_VER22 = 6;
        public const int DTWAIN_ACQUIREALL = (-1);
        public const int DTWAIN_MAXACQUIRE = (-1);
        public const int DTWAIN_DX_NONE = 0;
        public const int DTWAIN_DX_1PASSDUPLEX = 1;
        public const int DTWAIN_DX_2PASSDUPLEX = 2;
        public const int DTWAIN_PT_BW = 0;
        public const int DTWAIN_PT_GRAY = 1;
        public const int DTWAIN_PT_RGB = 2;
        public const int DTWAIN_PT_PALETTE = 3;
        public const int DTWAIN_PT_CMY = 4;
        public const int DTWAIN_PT_CMYK = 5;
        public const int DTWAIN_PT_YUV = 6;
        public const int DTWAIN_PT_YUVK = 7;
        public const int DTWAIN_PT_CIEXYZ = 8;
        public const int DTWAIN_PT_DEFAULT = 1000;
        public const int DTWAIN_CURRENT = (-2);
        public const int DTWAIN_DEFAULT = (-1);
        public const double DTWAIN_FLOATDEFAULT = (-9999.0);
        public const int DTWAIN_CallbackERROR = 1;
        public const int DTWAIN_CallbackMESSAGE = 2;
        public const int DTWAIN_USENATIVE = 1;
        public const int DTWAIN_USEBUFFERED = 2;
        public const int DTWAIN_USECOMPRESSION = 4;
        public const int DTWAIN_USEMEMFILE = 8;
        public const int DTWAIN_FAILURE1 = (-1);
        public const int DTWAIN_FAILURE2 = (-2);
        public const int DTWAIN_DELETEALL = (-1);
        public const int DTWAIN_TN_ACQUIREDONE = 1000;
        public const int DTWAIN_TN_ACQUIREFAILED = 1001;
        public const int DTWAIN_TN_ACQUIRECANCELLED = 1002;
        public const int DTWAIN_TN_ACQUIRESTARTED = 1003;
        public const int DTWAIN_TN_PAGECONTINUE = 1004;
        public const int DTWAIN_TN_PAGEFAILED = 1005;
        public const int DTWAIN_TN_PAGECANCELLED = 1006;
        public const int DTWAIN_TN_TRANSFERREADY = 1009;
        public const int DTWAIN_TN_TRANSFERDONE = 1010;
        public const int DTWAIN_TN_ACQUIREPAGEDONE = 1010;
        public const int DTWAIN_TN_UICLOSING = 3000;
        public const int DTWAIN_TN_UICLOSED = 3001;
        public const int DTWAIN_TN_UIOPENED = 3002;
        public const int DTWAIN_TN_UIOPENING = 3003;
        public const int DTWAIN_TN_UIOPENFAILURE = 3004;
        public const int DTWAIN_TN_CLIPTRANSFERDONE = 1014;
        public const int DTWAIN_TN_INVALIDIMAGEFORMAT = 1015;
        public const int DTWAIN_TN_ACQUIRETERMINATED = 1021;
        public const int DTWAIN_TN_TRANSFERSTRIPREADY = 1022;
        public const int DTWAIN_TN_TRANSFERSTRIPDONE = 1023;
        public const int DTWAIN_TN_TRANSFERSTRIPFAILED = 1029;
        public const int DTWAIN_TN_IMAGEINFOERROR = 1024;
        public const int DTWAIN_TN_TRANSFERCANCELLED = 1030;
        public const int DTWAIN_TN_FILESAVECANCELLED = 1031;
        public const int DTWAIN_TN_FILESAVEOK = 1032;
        public const int DTWAIN_TN_FILESAVEERROR = 1033;
        public const int DTWAIN_TN_FILEPAGESAVEOK = 1034;
        public const int DTWAIN_TN_FILEPAGESAVEERROR = 1035;
        public const int DTWAIN_TN_PROCESSEDDIB = 1036;
        public const int DTWAIN_TN_FEEDERLOADED = 1037;
        public const int DTWAIN_TN_GENERALERROR = 1038;
        public const int DTWAIN_TN_MANDUPFLIPPAGES = 1040;
        public const int DTWAIN_TN_MANDUPSIDE1DONE = 1041;
        public const int DTWAIN_TN_MANDUPSIDE2DONE = 1042;
        public const int DTWAIN_TN_MANDUPPAGECOUNTERROR = 1043;
        public const int DTWAIN_TN_MANDUPACQUIREDONE = 1044;
        public const int DTWAIN_TN_MANDUPSIDE1START = 1045;
        public const int DTWAIN_TN_MANDUPSIDE2START = 1046;
        public const int DTWAIN_TN_MANDUPMERGEERROR = 1047;
        public const int DTWAIN_TN_MANDUPMEMORYERROR = 1048;
        public const int DTWAIN_TN_MANDUPFILEERROR = 1049;
        public const int DTWAIN_TN_MANDUPFILESAVEERROR = 1050;
        public const int DTWAIN_TN_ENDOFJOBDETECTED = 1051;
        public const int DTWAIN_TN_EOJDETECTED = 1051;
        public const int DTWAIN_TN_EOJDETECTED_XFERDONE = 1052;
        public const int DTWAIN_TN_QUERYPAGEDISCARD = 1053;
        public const int DTWAIN_TN_PAGEDISCARDED = 1054;
        public const int DTWAIN_TN_PROCESSDIBACCEPTED = 1055;
        public const int DTWAIN_TN_PROCESSDIBFINALACCEPTED = 1056;
        public const int DTWAIN_TN_CLOSEDIBFAILED = 1057;
        public const int DTWAIN_TN_INVALID_TWAINDSM2_BITMAP = 1058;
        public const int DTWAIN_TN_IMAGE_RESAMPLE_FAILURE = 1059;
        public const int DTWAIN_TN_DEVICEEVENT = 1100;
        public const int DTWAIN_TN_TWAINPAGECANCELLED = 1105;
        public const int DTWAIN_TN_TWAINPAGEFAILED = 1106;
        public const int DTWAIN_TN_APPUPDATEDDIB = 1107;
        public const int DTWAIN_TN_FILEPAGESAVING = 1110;
        public const int DTWAIN_TN_EOJBEGINFILESAVE = 1112;
        public const int DTWAIN_TN_EOJENDFILESAVE = 1113;
        public const int DTWAIN_TN_CROPFAILED = 1120;
        public const int DTWAIN_TN_PROCESSEDDIBFINAL = 1121;
        public const int DTWAIN_TN_BLANKPAGEDETECTED1 = 1130;
        public const int DTWAIN_TN_BLANKPAGEDETECTED2 = 1131;
        public const int DTWAIN_TN_BLANKPAGEDETECTED3 = 1132;
        public const int DTWAIN_TN_BLANKPAGEDISCARDED1 = 1133;
        public const int DTWAIN_TN_BLANKPAGEDISCARDED2 = 1134;
        public const int DTWAIN_TN_OCRTEXTRETRIEVED = 1140;
        public const int DTWAIN_TN_QUERYOCRTEXT = 1141;
        public const int DTWAIN_TN_PDFOCRREADY = 1142;
        public const int DTWAIN_TN_PDFOCRDONE = 1143;
        public const int DTWAIN_TN_PDFOCRERROR = 1144;
        public const int DTWAIN_TN_SETCALLBACKINIT = 1150;
        public const int DTWAIN_TN_SETCALLBACK64INIT = 1151;
        public const int DTWAIN_TN_FILENAMECHANGING = 1160;
        public const int DTWAIN_TN_FILENAMECHANGED = 1161;
        public const int DTWAIN_TN_PROCESSEDAUDIOFINAL = 1180;
        public const int DTWAIN_TN_PROCESSAUDIOFINALACCEPTED = 1181;
        public const int DTWAIN_TN_PROCESSEDAUDIOFILE = 1182;
        public const int DTWAIN_TN_TWAINTRIPLETBEGIN = 1183;
        public const int DTWAIN_TN_TWAINTRIPLETEND = 1184;
        public const int DTWAIN_TN_FEEDERNOTLOADED = 1201;
        public const int DTWAIN_TN_FEEDERTIMEOUT = 1202;
        public const int DTWAIN_TN_FEEDERNOTENABLED = 1203;
        public const int DTWAIN_TN_FEEDERNOTSUPPORTED = 1204;
        public const int DTWAIN_TN_FEEDERTOFLATBED = 1205;
        public const int DTWAIN_TN_PREACQUIRESTART = 1206;
        public const int DTWAIN_TN_TRANSFERTILEREADY = 1300;
        public const int DTWAIN_TN_TRANSFERTILEDONE = 1301;
        public const int DTWAIN_TN_FILECOMPRESSTYPEMISMATCH = 1302;
        public const int DTWAIN_TN_SOURCEDETAILS = 1304;
        public const int DTWAIN_TN_QUERYACQUIREPAGES = 1305;
        public const int DTWAIN_TN_ACQUIREPAGESSTOPPING = 1306;
        public const int DTWAIN_TN_ACQUIREPAGESSTOPPED = 1307;
        public const int DTWAIN_TN_QUERYUPDATEDIBORIG = 1308;
        public const int DTWAIN_TN_QUERYUPDATEDIBRESAMPLED = 1309;
        public const int DTWAIN_PDFOCR_CLEANTEXT1 = 1;
        public const int DTWAIN_PDFOCR_CLEANTEXT2 = 2;
        public const int DTWAIN_MODAL = 0;
        public const int DTWAIN_MODELESS = 1;
        public const int DTWAIN_UIModeCLOSE = 0;
        public const int DTWAIN_UIModeOPEN = 1;
        public const int DTWAIN_REOPEN_SOURCE = 2;
        public const int DTWAIN_ROUNDNEAREST = 0;
        public const int DTWAIN_ROUNDUP = 1;
        public const int DTWAIN_ROUNDDOWN = 2;
        public const double DTWAIN_FLOATDELTA = (+1.0e-8);
        public const int DTWAIN_OR_ROT0 = 0;
        public const int DTWAIN_OR_ROT90 = 1;
        public const int DTWAIN_OR_ROT180 = 2;
        public const int DTWAIN_OR_ROT270 = 3;
        public const int DTWAIN_OR_PORTRAIT = DTWAIN_OR_ROT0;
        public const int DTWAIN_OR_LANDSCAPE = DTWAIN_OR_ROT270;
        public const int DTWAIN_OR_ANYROTATION = (-1);
        public const int DTWAIN_CO_GET = 0x0001;
        public const int DTWAIN_CO_SET = 0x0002;
        public const int DTWAIN_CO_GETDEFAULT = 0x0004;
        public const int DTWAIN_CO_GETCURRENT = 0x0008;
        public const int DTWAIN_CO_RESET = 0x0010;
        public const int DTWAIN_CO_SETCONSTRAINT = 0x0020;
        public const int DTWAIN_CO_CONSTRAINABLE = 0x0040;
        public const int DTWAIN_CO_GETHELP = 0x0100;
        public const int DTWAIN_CO_GETLABEL = 0x0200;
        public const int DTWAIN_CO_GETLABELENUM = 0x0400;
        public const int DTWAIN_CNTYAFGHANISTAN = 1001;
        public const int DTWAIN_CNTYALGERIA = 213;
        public const int DTWAIN_CNTYAMERICANSAMOA = 684;
        public const int DTWAIN_CNTYANDORRA = 33;
        public const int DTWAIN_CNTYANGOLA = 1002;
        public const int DTWAIN_CNTYANGUILLA = 8090;
        public const int DTWAIN_CNTYANTIGUA = 8091;
        public const int DTWAIN_CNTYARGENTINA = 54;
        public const int DTWAIN_CNTYARUBA = 297;
        public const int DTWAIN_CNTYASCENSIONI = 247;
        public const int DTWAIN_CNTYAUSTRALIA = 61;
        public const int DTWAIN_CNTYAUSTRIA = 43;
        public const int DTWAIN_CNTYBAHAMAS = 8092;
        public const int DTWAIN_CNTYBAHRAIN = 973;
        public const int DTWAIN_CNTYBANGLADESH = 880;
        public const int DTWAIN_CNTYBARBADOS = 8093;
        public const int DTWAIN_CNTYBELGIUM = 32;
        public const int DTWAIN_CNTYBELIZE = 501;
        public const int DTWAIN_CNTYBENIN = 229;
        public const int DTWAIN_CNTYBERMUDA = 8094;
        public const int DTWAIN_CNTYBHUTAN = 1003;
        public const int DTWAIN_CNTYBOLIVIA = 591;
        public const int DTWAIN_CNTYBOTSWANA = 267;
        public const int DTWAIN_CNTYBRITAIN = 6;
        public const int DTWAIN_CNTYBRITVIRGINIS = 8095;
        public const int DTWAIN_CNTYBRAZIL = 55;
        public const int DTWAIN_CNTYBRUNEI = 673;
        public const int DTWAIN_CNTYBULGARIA = 359;
        public const int DTWAIN_CNTYBURKINAFASO = 1004;
        public const int DTWAIN_CNTYBURMA = 1005;
        public const int DTWAIN_CNTYBURUNDI = 1006;
        public const int DTWAIN_CNTYCAMAROON = 237;
        public const int DTWAIN_CNTYCANADA = 2;
        public const int DTWAIN_CNTYCAPEVERDEIS = 238;
        public const int DTWAIN_CNTYCAYMANIS = 8096;
        public const int DTWAIN_CNTYCENTRALAFREP = 1007;
        public const int DTWAIN_CNTYCHAD = 1008;
        public const int DTWAIN_CNTYCHILE = 56;
        public const int DTWAIN_CNTYCHINA = 86;
        public const int DTWAIN_CNTYCHRISTMASIS = 1009;
        public const int DTWAIN_CNTYCOCOSIS = 1009;
        public const int DTWAIN_CNTYCOLOMBIA = 57;
        public const int DTWAIN_CNTYCOMOROS = 1010;
        public const int DTWAIN_CNTYCONGO = 1011;
        public const int DTWAIN_CNTYCOOKIS = 1012;
        public const int DTWAIN_CNTYCOSTARICA = 506;
        public const int DTWAIN_CNTYCUBA = 5;
        public const int DTWAIN_CNTYCYPRUS = 357;
        public const int DTWAIN_CNTYCZECHOSLOVAKIA = 42;
        public const int DTWAIN_CNTYDENMARK = 45;
        public const int DTWAIN_CNTYDJIBOUTI = 1013;
        public const int DTWAIN_CNTYDOMINICA = 8097;
        public const int DTWAIN_CNTYDOMINCANREP = 8098;
        public const int DTWAIN_CNTYEASTERIS = 1014;
        public const int DTWAIN_CNTYECUADOR = 593;
        public const int DTWAIN_CNTYEGYPT = 20;
        public const int DTWAIN_CNTYELSALVADOR = 503;
        public const int DTWAIN_CNTYEQGUINEA = 1015;
        public const int DTWAIN_CNTYETHIOPIA = 251;
        public const int DTWAIN_CNTYFALKLANDIS = 1016;
        public const int DTWAIN_CNTYFAEROEIS = 298;
        public const int DTWAIN_CNTYFIJIISLANDS = 679;
        public const int DTWAIN_CNTYFINLAND = 358;
        public const int DTWAIN_CNTYFRANCE = 33;
        public const int DTWAIN_CNTYFRANTILLES = 596;
        public const int DTWAIN_CNTYFRGUIANA = 594;
        public const int DTWAIN_CNTYFRPOLYNEISA = 689;
        public const int DTWAIN_CNTYFUTANAIS = 1043;
        public const int DTWAIN_CNTYGABON = 241;
        public const int DTWAIN_CNTYGAMBIA = 220;
        public const int DTWAIN_CNTYGERMANY = 49;
        public const int DTWAIN_CNTYGHANA = 233;
        public const int DTWAIN_CNTYGIBRALTER = 350;
        public const int DTWAIN_CNTYGREECE = 30;
        public const int DTWAIN_CNTYGREENLAND = 299;
        public const int DTWAIN_CNTYGRENADA = 8099;
        public const int DTWAIN_CNTYGRENEDINES = 8015;
        public const int DTWAIN_CNTYGUADELOUPE = 590;
        public const int DTWAIN_CNTYGUAM = 671;
        public const int DTWAIN_CNTYGUANTANAMOBAY = 5399;
        public const int DTWAIN_CNTYGUATEMALA = 502;
        public const int DTWAIN_CNTYGUINEA = 224;
        public const int DTWAIN_CNTYGUINEABISSAU = 1017;
        public const int DTWAIN_CNTYGUYANA = 592;
        public const int DTWAIN_CNTYHAITI = 509;
        public const int DTWAIN_CNTYHONDURAS = 504;
        public const int DTWAIN_CNTYHONGKONG = 852;
        public const int DTWAIN_CNTYHUNGARY = 36;
        public const int DTWAIN_CNTYICELAND = 354;
        public const int DTWAIN_CNTYINDIA = 91;
        public const int DTWAIN_CNTYINDONESIA = 62;
        public const int DTWAIN_CNTYIRAN = 98;
        public const int DTWAIN_CNTYIRAQ = 964;
        public const int DTWAIN_CNTYIRELAND = 353;
        public const int DTWAIN_CNTYISRAEL = 972;
        public const int DTWAIN_CNTYITALY = 39;
        public const int DTWAIN_CNTYIVORYCOAST = 225;
        public const int DTWAIN_CNTYJAMAICA = 8010;
        public const int DTWAIN_CNTYJAPAN = 81;
        public const int DTWAIN_CNTYJORDAN = 962;
        public const int DTWAIN_CNTYKENYA = 254;
        public const int DTWAIN_CNTYKIRIBATI = 1018;
        public const int DTWAIN_CNTYKOREA = 82;
        public const int DTWAIN_CNTYKUWAIT = 965;
        public const int DTWAIN_CNTYLAOS = 1019;
        public const int DTWAIN_CNTYLEBANON = 1020;
        public const int DTWAIN_CNTYLIBERIA = 231;
        public const int DTWAIN_CNTYLIBYA = 218;
        public const int DTWAIN_CNTYLIECHTENSTEIN = 41;
        public const int DTWAIN_CNTYLUXENBOURG = 352;
        public const int DTWAIN_CNTYMACAO = 853;
        public const int DTWAIN_CNTYMADAGASCAR = 1021;
        public const int DTWAIN_CNTYMALAWI = 265;
        public const int DTWAIN_CNTYMALAYSIA = 60;
        public const int DTWAIN_CNTYMALDIVES = 960;
        public const int DTWAIN_CNTYMALI = 1022;
        public const int DTWAIN_CNTYMALTA = 356;
        public const int DTWAIN_CNTYMARSHALLIS = 692;
        public const int DTWAIN_CNTYMAURITANIA = 1023;
        public const int DTWAIN_CNTYMAURITIUS = 230;
        public const int DTWAIN_CNTYMEXICO = 3;
        public const int DTWAIN_CNTYMICRONESIA = 691;
        public const int DTWAIN_CNTYMIQUELON = 508;
        public const int DTWAIN_CNTYMONACO = 33;
        public const int DTWAIN_CNTYMONGOLIA = 1024;
        public const int DTWAIN_CNTYMONTSERRAT = 8011;
        public const int DTWAIN_CNTYMOROCCO = 212;
        public const int DTWAIN_CNTYMOZAMBIQUE = 1025;
        public const int DTWAIN_CNTYNAMIBIA = 264;
        public const int DTWAIN_CNTYNAURU = 1026;
        public const int DTWAIN_CNTYNEPAL = 977;
        public const int DTWAIN_CNTYNETHERLANDS = 31;
        public const int DTWAIN_CNTYNETHANTILLES = 599;
        public const int DTWAIN_CNTYNEVIS = 8012;
        public const int DTWAIN_CNTYNEWCALEDONIA = 687;
        public const int DTWAIN_CNTYNEWZEALAND = 64;
        public const int DTWAIN_CNTYNICARAGUA = 505;
        public const int DTWAIN_CNTYNIGER = 227;
        public const int DTWAIN_CNTYNIGERIA = 234;
        public const int DTWAIN_CNTYNIUE = 1027;
        public const int DTWAIN_CNTYNORFOLKI = 1028;
        public const int DTWAIN_CNTYNORWAY = 47;
        public const int DTWAIN_CNTYOMAN = 968;
        public const int DTWAIN_CNTYPAKISTAN = 92;
        public const int DTWAIN_CNTYPALAU = 1029;
        public const int DTWAIN_CNTYPANAMA = 507;
        public const int DTWAIN_CNTYPARAGUAY = 595;
        public const int DTWAIN_CNTYPERU = 51;
        public const int DTWAIN_CNTYPHILLIPPINES = 63;
        public const int DTWAIN_CNTYPITCAIRNIS = 1030;
        public const int DTWAIN_CNTYPNEWGUINEA = 675;
        public const int DTWAIN_CNTYPOLAND = 48;
        public const int DTWAIN_CNTYPORTUGAL = 351;
        public const int DTWAIN_CNTYQATAR = 974;
        public const int DTWAIN_CNTYREUNIONI = 1031;
        public const int DTWAIN_CNTYROMANIA = 40;
        public const int DTWAIN_CNTYRWANDA = 250;
        public const int DTWAIN_CNTYSAIPAN = 670;
        public const int DTWAIN_CNTYSANMARINO = 39;
        public const int DTWAIN_CNTYSAOTOME = 1033;
        public const int DTWAIN_CNTYSAUDIARABIA = 966;
        public const int DTWAIN_CNTYSENEGAL = 221;
        public const int DTWAIN_CNTYSEYCHELLESIS = 1034;
        public const int DTWAIN_CNTYSIERRALEONE = 1035;
        public const int DTWAIN_CNTYSINGAPORE = 65;
        public const int DTWAIN_CNTYSOLOMONIS = 1036;
        public const int DTWAIN_CNTYSOMALI = 1037;
        public const int DTWAIN_CNTYSOUTHAFRICA = 27;
        public const int DTWAIN_CNTYSPAIN = 34;
        public const int DTWAIN_CNTYSRILANKA = 94;
        public const int DTWAIN_CNTYSTHELENA = 1032;
        public const int DTWAIN_CNTYSTKITTS = 8013;
        public const int DTWAIN_CNTYSTLUCIA = 8014;
        public const int DTWAIN_CNTYSTPIERRE = 508;
        public const int DTWAIN_CNTYSTVINCENT = 8015;
        public const int DTWAIN_CNTYSUDAN = 1038;
        public const int DTWAIN_CNTYSURINAME = 597;
        public const int DTWAIN_CNTYSWAZILAND = 268;
        public const int DTWAIN_CNTYSWEDEN = 46;
        public const int DTWAIN_CNTYSWITZERLAND = 41;
        public const int DTWAIN_CNTYSYRIA = 1039;
        public const int DTWAIN_CNTYTAIWAN = 886;
        public const int DTWAIN_CNTYTANZANIA = 255;
        public const int DTWAIN_CNTYTHAILAND = 66;
        public const int DTWAIN_CNTYTOBAGO = 8016;
        public const int DTWAIN_CNTYTOGO = 228;
        public const int DTWAIN_CNTYTONGAIS = 676;
        public const int DTWAIN_CNTYTRINIDAD = 8016;
        public const int DTWAIN_CNTYTUNISIA = 216;
        public const int DTWAIN_CNTYTURKEY = 90;
        public const int DTWAIN_CNTYTURKSCAICOS = 8017;
        public const int DTWAIN_CNTYTUVALU = 1040;
        public const int DTWAIN_CNTYUGANDA = 256;
        public const int DTWAIN_CNTYUSSR = 7;
        public const int DTWAIN_CNTYUAEMIRATES = 971;
        public const int DTWAIN_CNTYUNITEDKINGDOM = 44;
        public const int DTWAIN_CNTYUSA = 1;
        public const int DTWAIN_CNTYURUGUAY = 598;
        public const int DTWAIN_CNTYVANUATU = 1041;
        public const int DTWAIN_CNTYVATICANCITY = 39;
        public const int DTWAIN_CNTYVENEZUELA = 58;
        public const int DTWAIN_CNTYWAKE = 1042;
        public const int DTWAIN_CNTYWALLISIS = 1043;
        public const int DTWAIN_CNTYWESTERNSAHARA = 1044;
        public const int DTWAIN_CNTYWESTERNSAMOA = 1045;
        public const int DTWAIN_CNTYYEMEN = 1046;
        public const int DTWAIN_CNTYYUGOSLAVIA = 38;
        public const int DTWAIN_CNTYZAIRE = 243;
        public const int DTWAIN_CNTYZAMBIA = 260;
        public const int DTWAIN_CNTYZIMBABWE = 263;
        public const int DTWAIN_LANGDANISH = 0;
        public const int DTWAIN_LANGDUTCH = 1;
        public const int DTWAIN_LANGINTERNATIONALENGLISH = 2;
        public const int DTWAIN_LANGFRENCHCANADIAN = 3;
        public const int DTWAIN_LANGFINNISH = 4;
        public const int DTWAIN_LANGFRENCH = 5;
        public const int DTWAIN_LANGGERMAN = 6;
        public const int DTWAIN_LANGICELANDIC = 7;
        public const int DTWAIN_LANGITALIAN = 8;
        public const int DTWAIN_LANGNORWEGIAN = 9;
        public const int DTWAIN_LANGPORTUGUESE = 10;
        public const int DTWAIN_LANGSPANISH = 11;
        public const int DTWAIN_LANGSWEDISH = 12;
        public const int DTWAIN_LANGUSAENGLISH = 13;
        public const int DTWAIN_NO_ERROR = (0);
        public const int DTWAIN_ERR_FIRST = (-1000);
        public const int DTWAIN_ERR_BAD_HANDLE = (-1001);
        public const int DTWAIN_ERR_BAD_SOURCE = (-1002);
        public const int DTWAIN_ERR_BAD_ARRAY = (-1003);
        public const int DTWAIN_ERR_WRONG_ARRAY_TYPE = (-1004);
        public const int DTWAIN_ERR_INDEX_BOUNDS = (-1005);
        public const int DTWAIN_ERR_OUT_OF_MEMORY = (-1006);
        public const int DTWAIN_ERR_NULL_WINDOW = (-1007);
        public const int DTWAIN_ERR_BAD_PIXTYPE = (-1008);
        public const int DTWAIN_ERR_BAD_CONTAINER = (-1009);
        public const int DTWAIN_ERR_NO_SESSION = (-1010);
        public const int DTWAIN_ERR_BAD_ACQUIRE_NUM = (-1011);
        public const int DTWAIN_ERR_BAD_CAP = (-1012);
        public const int DTWAIN_ERR_CAP_NO_SUPPORT = (-1013);
        public const int DTWAIN_ERR_TWAIN = (-1014);
        public const int DTWAIN_ERR_HOOK_FAILED = (-1015);
        public const int DTWAIN_ERR_BAD_FILENAME = (-1016);
        public const int DTWAIN_ERR_EMPTY_ARRAY = (-1017);
        public const int DTWAIN_ERR_FILE_FORMAT = (-1018);
        public const int DTWAIN_ERR_BAD_DIB_PAGE = (-1019);
        public const int DTWAIN_ERR_SOURCE_ACQUIRING = (-1020);
        public const int DTWAIN_ERR_INVALID_PARAM = (-1021);
        public const int DTWAIN_ERR_INVALID_RANGE = (-1022);
        public const int DTWAIN_ERR_UI_ERROR = (-1023);
        public const int DTWAIN_ERR_BAD_UNIT = (-1024);
        public const int DTWAIN_ERR_LANGDLL_NOT_FOUND = (-1025);
        public const int DTWAIN_ERR_SOURCE_NOT_OPEN = (-1026);
        public const int DTWAIN_ERR_DEVICEEVENT_NOT_SUPPORTED = (-1027);
        public const int DTWAIN_ERR_UIONLY_NOT_SUPPORTED = (-1028);
        public const int DTWAIN_ERR_UI_ALREADY_OPENED = (-1029);
        public const int DTWAIN_ERR_CAPSET_NOSUPPORT = (-1030);
        public const int DTWAIN_ERR_NO_FILE_XFER = (-1031);
        public const int DTWAIN_ERR_INVALID_BITDEPTH = (-1032);
        public const int DTWAIN_ERR_NO_CAPS_DEFINED = (-1033);
        public const int DTWAIN_ERR_TILES_NOT_SUPPORTED = (-1034);
        public const int DTWAIN_ERR_INVALID_DTWAIN_FRAME = (-1035);
        public const int DTWAIN_ERR_LIMITED_VERSION = (-1036);
        public const int DTWAIN_ERR_NO_FEEDER = (-1037);
        public const int DTWAIN_ERR_NO_FEEDER_QUERY = (-1038);
        public const int DTWAIN_ERR_EXCEPTION_ERROR = (-1039);
        public const int DTWAIN_ERR_INVALID_STATE = (-1040);
        public const int DTWAIN_ERR_UNSUPPORTED_EXTINFO = (-1041);
        public const int DTWAIN_ERR_DLLRESOURCE_NOTFOUND = (-1042);
        public const int DTWAIN_ERR_NOT_INITIALIZED = (-1043);
        public const int DTWAIN_ERR_NO_SOURCES = (-1044);
        public const int DTWAIN_ERR_TWAIN_NOT_INSTALLED = (-1045);
        public const int DTWAIN_ERR_WRONG_THREAD = (-1046);
        public const int DTWAIN_ERR_BAD_CAPTYPE = (-1047);
        public const int DTWAIN_ERR_UNKNOWN_CAPDATATYPE = (-1048);
        public const int DTWAIN_ERR_DEMO_NOFILETYPE = (-1049);
        public const int DTWAIN_ERR_SOURCESELECTION_CANCELED = (-1050);
        public const int DTWAIN_ERR_RESOURCES_NOT_FOUND = (-1051);
        public const int DTWAIN_ERR_STRINGTYPE_MISMATCH = (-1052);
        public const int DTWAIN_ERR_ARRAYTYPE_MISMATCH = (-1053);
        public const int DTWAIN_ERR_SOURCENAME_NOTINSTALLED = (-1054);
        public const int DTWAIN_ERR_NO_MEMFILE_XFER = (-1055);
        public const int DTWAIN_ERR_AREA_ARRAY_TOO_SMALL = (-1056);
        public const int DTWAIN_ERR_LOG_CREATE_ERROR = (-1057);
        public const int DTWAIN_ERR_FILESYSTEM_NOT_SUPPORTED = (-1058);
        public const int DTWAIN_ERR_TILEMODE_NOTSET = (-1059);
        public const int DTWAIN_ERR_INI32_NOT_FOUND = (-1060);
        public const int DTWAIN_ERR_INI64_NOT_FOUND = (-1061);
        public const int DTWAIN_ERR_CRC_CHECK = (-1062);
        public const int DTWAIN_ERR_RESOURCES_BAD_VERSION = (-1063);
        public const int DTWAIN_ERR_WIN32_ERROR = (-1064);
        public const int DTWAIN_ERR_STRINGID_NOTFOUND = (-1065);
        public const int DTWAIN_ERR_RESOURCES_DUPLICATEID_FOUND = (-1066);
        public const int DTWAIN_ERR_UNAVAILABLE_EXTINFO = (-1067);
        public const int DTWAIN_ERR_TWAINDSM2_BADBITMAP = (-1068);
        public const int DTWAIN_ERR_ACQUISITION_CANCELED = (-1069);
        public const int DTWAIN_ERR_IMAGE_RESAMPLED = (-1070);
        public const int DTWAIN_ERR_UNKNOWN_TWAIN_RC = (-1071);
        public const int DTWAIN_ERR_UNKNOWN_TWAIN_CC = (-1072);
        public const int DTWAIN_ERR_RESOURCES_DATA_EXCEPTION = (-1073);
        public const int DTWAIN_ERR_AUDIO_TRANSFER_NOTSUPPORTED = (-1074);
        public const int DTWAIN_ERR_FEEDER_COMPLIANCY = (-1075);
        public const int DTWAIN_ERR_SUPPORTEDCAPS_COMPLIANCY1 = (-1076);
        public const int DTWAIN_ERR_SUPPORTEDCAPS_COMPLIANCY2 = (-1077);
        public const int DTWAIN_ERR_ICAPPIXELTYPE_COMPLIANCY1 = (-1078);
        public const int DTWAIN_ERR_ICAPPIXELTYPE_COMPLIANCY2 = (-1079);
        public const int DTWAIN_ERR_ICAPBITDEPTH_COMPLIANCY1 = (-1080);
        public const int DTWAIN_ERR_XFERMECH_COMPLIANCY = (-1081);
        public const int DTWAIN_ERR_STANDARDCAPS_COMPLIANCY = (-1082);
        public const int DTWAIN_ERR_EXTIMAGEINFO_DATATYPE_MISMATCH = (-1083);
        public const int DTWAIN_ERR_EXTIMAGEINFO_RETRIEVAL = (-1084);
        public const int DTWAIN_ERR_RANGE_OUTOFBOUNDS = (-1085);
        public const int DTWAIN_ERR_RANGE_STEPISZERO = (-1086);
        public const int DTWAIN_ERR_BLANKNAMEDETECTED = (-1087);
        public const int DTWAIN_ERR_FEEDER_NOPAPERSENSOR = (-1088);
        public const int TWAIN_ERR_LOW_MEMORY = (-1100);
        public const int TWAIN_ERR_FALSE_ALARM = (-1101);
        public const int TWAIN_ERR_BUMMER = (-1102);
        public const int TWAIN_ERR_NODATASOURCE = (-1103);
        public const int TWAIN_ERR_MAXCONNECTIONS = (-1104);
        public const int TWAIN_ERR_OPERATIONERROR = (-1105);
        public const int TWAIN_ERR_BADCAPABILITY = (-1106);
        public const int TWAIN_ERR_BADVALUE = (-1107);
        public const int TWAIN_ERR_BADPROTOCOL = (-1108);
        public const int TWAIN_ERR_SEQUENCEERROR = (-1109);
        public const int TWAIN_ERR_BADDESTINATION = (-1110);
        public const int TWAIN_ERR_CAPNOTSUPPORTED = (-1111);
        public const int TWAIN_ERR_CAPBADOPERATION = (-1112);
        public const int TWAIN_ERR_CAPSEQUENCEERROR = (-1113);
        public const int TWAIN_ERR_FILEPROTECTEDERROR = (-1114);
        public const int TWAIN_ERR_FILEEXISTERROR = (-1115);
        public const int TWAIN_ERR_FILENOTFOUND = (-1116);
        public const int TWAIN_ERR_DIRNOTEMPTY = (-1117);
        public const int TWAIN_ERR_FEEDERJAMMED = (-1118);
        public const int TWAIN_ERR_FEEDERMULTPAGES = (-1119);
        public const int TWAIN_ERR_FEEDERWRITEERROR = (-1120);
        public const int TWAIN_ERR_DEVICEOFFLINE = (-1121);
        public const int TWAIN_ERR_NULL_CONTAINER = (-1122);
        public const int TWAIN_ERR_INTERLOCK = (-1123);
        public const int TWAIN_ERR_DAMAGEDCORNER = (-1124);
        public const int TWAIN_ERR_FOCUSERROR = (-1125);
        public const int TWAIN_ERR_DOCTOOLIGHT = (-1126);
        public const int TWAIN_ERR_DOCTOODARK = (-1127);
        public const int TWAIN_ERR_NOMEDIA = (-1128);
        public const int DTWAIN_ERR_FILEXFERSTART = (-2000);
        public const int DTWAIN_ERR_MEM = (-2001);
        public const int DTWAIN_ERR_FILEOPEN = (-2002);
        public const int DTWAIN_ERR_FILEREAD = (-2003);
        public const int DTWAIN_ERR_FILEWRITE = (-2004);
        public const int DTWAIN_ERR_BADPARAM = (-2005);
        public const int DTWAIN_ERR_INVALIDBMP = (-2006);
        public const int DTWAIN_ERR_BMPRLE = (-2007);
        public const int DTWAIN_ERR_RESERVED1 = (-2008);
        public const int DTWAIN_ERR_INVALIDJPG = (-2009);
        public const int DTWAIN_ERR_DC = (-2010);
        public const int DTWAIN_ERR_DIB = (-2011);
        public const int DTWAIN_ERR_RESERVED2 = (-2012);
        public const int DTWAIN_ERR_NORESOURCE = (-2013);
        public const int DTWAIN_ERR_CALLBACKCANCEL = (-2014);
        public const int DTWAIN_ERR_INVALIDPNG = (-2015);
        public const int DTWAIN_ERR_PNGCREATE = (-2016);
        public const int DTWAIN_ERR_INTERNAL = (-2017);
        public const int DTWAIN_ERR_FONT = (-2018);
        public const int DTWAIN_ERR_INTTIFF = (-2019);
        public const int DTWAIN_ERR_INVALIDTIFF = (-2020);
        public const int DTWAIN_ERR_NOTIFFLZW = (-2021);
        public const int DTWAIN_ERR_INVALIDPCX = (-2022);
        public const int DTWAIN_ERR_CREATEBMP = (-2023);
        public const int DTWAIN_ERR_NOLINES = (-2024);
        public const int DTWAIN_ERR_GETDIB = (-2025);
        public const int DTWAIN_ERR_NODEVOP = (-2026);
        public const int DTWAIN_ERR_INVALIDWMF = (-2027);
        public const int DTWAIN_ERR_DEPTHMISMATCH = (-2028);
        public const int DTWAIN_ERR_BITBLT = (-2029);
        public const int DTWAIN_ERR_BUFTOOSMALL = (-2030);
        public const int DTWAIN_ERR_TOOMANYCOLORS = (-2031);
        public const int DTWAIN_ERR_INVALIDTGA = (-2032);
        public const int DTWAIN_ERR_NOTGATHUMBNAIL = (-2033);
        public const int DTWAIN_ERR_RESERVED3 = (-2034);
        public const int DTWAIN_ERR_CREATEDIB = (-2035);
        public const int DTWAIN_ERR_NOLZW = (-2036);
        public const int DTWAIN_ERR_SELECTOBJ = (-2037);
        public const int DTWAIN_ERR_BADMANAGER = (-2038);
        public const int DTWAIN_ERR_OBSOLETE = (-2039);
        public const int DTWAIN_ERR_CREATEDIBSECTION = (-2040);
        public const int DTWAIN_ERR_SETWINMETAFILEBITS = (-2041);
        public const int DTWAIN_ERR_GETWINMETAFILEBITS = (-2042);
        public const int DTWAIN_ERR_PAXPWD = (-2043);
        public const int DTWAIN_ERR_INVALIDPAX = (-2044);
        public const int DTWAIN_ERR_NOSUPPORT = (-2045);
        public const int DTWAIN_ERR_INVALIDPSD = (-2046);
        public const int DTWAIN_ERR_PSDNOTSUPPORTED = (-2047);
        public const int DTWAIN_ERR_DECRYPT = (-2048);
        public const int DTWAIN_ERR_ENCRYPT = (-2049);
        public const int DTWAIN_ERR_COMPRESSION = (-2050);
        public const int DTWAIN_ERR_DECOMPRESSION = (-2051);
        public const int DTWAIN_ERR_INVALIDTLA = (-2052);
        public const int DTWAIN_ERR_INVALIDWBMP = (-2053);
        public const int DTWAIN_ERR_NOTIFFTAG = (-2054);
        public const int DTWAIN_ERR_NOLOCALSTORAGE = (-2055);
        public const int DTWAIN_ERR_INVALIDEXIF = (-2056);
        public const int DTWAIN_ERR_NOEXIFSTRING = (-2057);
        public const int DTWAIN_ERR_TIFFDLL32NOTFOUND = (-2058);
        public const int DTWAIN_ERR_TIFFDLL16NOTFOUND = (-2059);
        public const int DTWAIN_ERR_PNGDLL16NOTFOUND = (-2060);
        public const int DTWAIN_ERR_JPEGDLL16NOTFOUND = (-2061);
        public const int DTWAIN_ERR_BADBITSPERPIXEL = (-2062);
        public const int DTWAIN_ERR_TIFFDLL32INVALIDVER = (-2063);
        public const int DTWAIN_ERR_PDFDLL32NOTFOUND = (-2064);
        public const int DTWAIN_ERR_PDFDLL32INVALIDVER = (-2065);
        public const int DTWAIN_ERR_JPEGDLL32NOTFOUND = (-2066);
        public const int DTWAIN_ERR_JPEGDLL32INVALIDVER = (-2067);
        public const int DTWAIN_ERR_PNGDLL32NOTFOUND = (-2068);
        public const int DTWAIN_ERR_PNGDLL32INVALIDVER = (-2069);
        public const int DTWAIN_ERR_J2KDLL32NOTFOUND = (-2070);
        public const int DTWAIN_ERR_J2KDLL32INVALIDVER = (-2071);
        public const int DTWAIN_ERR_MANDUPLEX_UNAVAILABLE = (-2072);
        public const int DTWAIN_ERR_TIMEOUT = (-2073);
        public const int DTWAIN_ERR_INVALIDICONFORMAT = (-2074);
        public const int DTWAIN_ERR_TWAIN32DSMNOTFOUND = (-2075);
        public const int DTWAIN_ERR_TWAINOPENSOURCEDSMNOTFOUND = (-2076);
        public const int DTWAIN_ERR_INVALID_DIRECTORY = (-2077);
        public const int DTWAIN_ERR_CREATE_DIRECTORY = (-2078);
        public const int DTWAIN_ERR_OCRLIBRARY_NOTFOUND = (-2079);
        public const int DTWAIN_TWAINSAVE_OK = (0);
        public const int DTWAIN_ERR_TS_FIRST = (-2080);
        public const int DTWAIN_ERR_TS_NOFILENAME = (-2081);
        public const int DTWAIN_ERR_TS_NOTWAINSYS = (-2082);
        public const int DTWAIN_ERR_TS_DEVICEFAILURE = (-2083);
        public const int DTWAIN_ERR_TS_FILESAVEERROR = (-2084);
        public const int DTWAIN_ERR_TS_COMMANDILLEGAL = (-2085);
        public const int DTWAIN_ERR_TS_CANCELLED = (-2086);
        public const int DTWAIN_ERR_TS_ACQUISITIONERROR = (-2087);
        public const int DTWAIN_ERR_TS_INVALIDCOLORSPACE = (-2088);
        public const int DTWAIN_ERR_TS_PDFNOTSUPPORTED = (-2089);
        public const int DTWAIN_ERR_TS_NOTAVAILABLE = (-2090);
        public const int DTWAIN_ERR_OCR_FIRST = (-2100);
        public const int DTWAIN_ERR_OCR_INVALIDPAGENUM = (-2101);
        public const int DTWAIN_ERR_OCR_INVALIDENGINE = (-2102);
        public const int DTWAIN_ERR_OCR_NOTACTIVE = (-2103);
        public const int DTWAIN_ERR_OCR_INVALIDFILETYPE = (-2104);
        public const int DTWAIN_ERR_OCR_INVALIDPIXELTYPE = (-2105);
        public const int DTWAIN_ERR_OCR_INVALIDBITDEPTH = (-2106);
        public const int DTWAIN_ERR_OCR_RECOGNITIONERROR = (-2107);
        public const int DTWAIN_ERR_OCR_LAST = (-2108);
        public const int DTWAIN_ERR_LAST = DTWAIN_ERR_OCR_LAST;
        public const int DTWAIN_ERR_SOURCE_COULD_NOT_OPEN = (-2500);
        public const int DTWAIN_ERR_SOURCE_COULD_NOT_CLOSE = (-2501);
        public const int DTWAIN_ERR_IMAGEINFO_INVALID = (-2502);
        public const int DTWAIN_ERR_WRITEDATA_TOFILE = (-2503);
        public const int DTWAIN_ERR_OPERATION_NOTSUPPORTED = (-2504);
        public const int DTWAIN_ERR_INVALID_PDFTEXTELEMENT = (-2505);
        public const int DTWAIN_ERR_SETCAP_FAILED = (-2506);
        public const int DTWAIN_ERR_CAP_INVALIDSTATE = (-2507);
        public const int DTWAIN_ERR_GETCAP_FAILED = (-2508);
        public const int DTWAIN_DE_CHKAUTOCAPTURE = 1;
        public const int DTWAIN_DE_CHKBATTERY = 2;
        public const int DTWAIN_DE_CHKDEVICEONLINE = 4;
        public const int DTWAIN_DE_CHKFLASH = 8;
        public const int DTWAIN_DE_CHKPOWERSUPPLY = 16;
        public const int DTWAIN_DE_CHKRESOLUTION = 32;
        public const int DTWAIN_DE_DEVICEADDED = 64;
        public const int DTWAIN_DE_DEVICEOFFLINE = 128;
        public const int DTWAIN_DE_DEVICEREADY = 256;
        public const int DTWAIN_DE_DEVICEREMOVED = 512;
        public const int DTWAIN_DE_IMAGECAPTURED = 1024;
        public const int DTWAIN_DE_IMAGEDELETED = 2048;
        public const int DTWAIN_DE_PAPERDOUBLEFEED = 4096;
        public const int DTWAIN_DE_PAPERJAM = 8192;
        public const int DTWAIN_DE_LAMPFAILURE = 16384;
        public const int DTWAIN_DE_POWERSAVE = 32768;
        public const int DTWAIN_DE_POWERSAVENOTIFY = 65536;
        public const int DTWAIN_DE_CUSTOMEVENTS = 0x8000;
        public const int DTWAIN_GETDE_EVENT = 0;
        public const int DTWAIN_GETDE_DEVNAME = 1;
        public const int DTWAIN_GETDE_BATTERYMINUTES = 2;
        public const int DTWAIN_GETDE_BATTERYPCT = 3;
        public const int DTWAIN_GETDE_XRESOLUTION = 4;
        public const int DTWAIN_GETDE_YRESOLUTION = 5;
        public const int DTWAIN_GETDE_FLASHUSED = 6;
        public const int DTWAIN_GETDE_AUTOCAPTURE = 7;
        public const int DTWAIN_GETDE_TIMEBEFORECAPTURE = 8;
        public const int DTWAIN_GETDE_TIMEBETWEENCAPTURES = 9;
        public const int DTWAIN_GETDE_POWERSUPPLY = 10;
        public const int DTWAIN_IMPRINTERTOPBEFORE = 1;
        public const int DTWAIN_IMPRINTERTOPAFTER = 2;
        public const int DTWAIN_IMPRINTERBOTTOMBEFORE = 4;
        public const int DTWAIN_IMPRINTERBOTTOMAFTER = 8;
        public const int DTWAIN_ENDORSERTOPBEFORE = 16;
        public const int DTWAIN_ENDORSERTOPAFTER = 32;
        public const int DTWAIN_ENDORSERBOTTOMBEFORE = 64;
        public const int DTWAIN_ENDORSERBOTTOMAFTER = 128;
        public const int DTWAIN_PM_SINGLESTRING = 0;
        public const int DTWAIN_PM_MULTISTRING = 1;
        public const int DTWAIN_PM_COMPOUNDSTRING = 2;
        public const int DTWAIN_TWTY_INT8 = 0x0000;
        public const int DTWAIN_TWTY_INT16 = 0x0001;
        public const int DTWAIN_TWTY_INT32 = 0x0002;
        public const int DTWAIN_TWTY_UINT8 = 0x0003;
        public const int DTWAIN_TWTY_UINT16 = 0x0004;
        public const int DTWAIN_TWTY_UINT32 = 0x0005;
        public const int DTWAIN_TWTY_BOOL = 0x0006;
        public const int DTWAIN_TWTY_FIX32 = 0x0007;
        public const int DTWAIN_TWTY_FRAME = 0x0008;
        public const int DTWAIN_TWTY_STR32 = 0x0009;
        public const int DTWAIN_TWTY_STR64 = 0x000A;
        public const int DTWAIN_TWTY_STR128 = 0x000B;
        public const int DTWAIN_TWTY_STR255 = 0x000C;
        public const int DTWAIN_TWTY_STR1024 = 0x000D;
        public const int DTWAIN_TWTY_UNI512 = 0x000E;
        public const int DTWAIN_EI_BARCODEX = 0x1200;
        public const int DTWAIN_EI_BARCODEY = 0x1201;
        public const int DTWAIN_EI_BARCODETEXT = 0x1202;
        public const int DTWAIN_EI_BARCODETYPE = 0x1203;
        public const int DTWAIN_EI_DESHADETOP = 0x1204;
        public const int DTWAIN_EI_DESHADELEFT = 0x1205;
        public const int DTWAIN_EI_DESHADEHEIGHT = 0x1206;
        public const int DTWAIN_EI_DESHADEWIDTH = 0x1207;
        public const int DTWAIN_EI_DESHADESIZE = 0x1208;
        public const int DTWAIN_EI_SPECKLESREMOVED = 0x1209;
        public const int DTWAIN_EI_HORZLINEXCOORD = 0x120A;
        public const int DTWAIN_EI_HORZLINEYCOORD = 0x120B;
        public const int DTWAIN_EI_HORZLINELENGTH = 0x120C;
        public const int DTWAIN_EI_HORZLINETHICKNESS = 0x120D;
        public const int DTWAIN_EI_VERTLINEXCOORD = 0x120E;
        public const int DTWAIN_EI_VERTLINEYCOORD = 0x120F;
        public const int DTWAIN_EI_VERTLINELENGTH = 0x1210;
        public const int DTWAIN_EI_VERTLINETHICKNESS = 0x1211;
        public const int DTWAIN_EI_PATCHCODE = 0x1212;
        public const int DTWAIN_EI_ENDORSEDTEXT = 0x1213;
        public const int DTWAIN_EI_FORMCONFIDENCE = 0x1214;
        public const int DTWAIN_EI_FORMTEMPLATEMATCH = 0x1215;
        public const int DTWAIN_EI_FORMTEMPLATEPAGEMATCH = 0x1216;
        public const int DTWAIN_EI_FORMHORZDOCOFFSET = 0x1217;
        public const int DTWAIN_EI_FORMVERTDOCOFFSET = 0x1218;
        public const int DTWAIN_EI_BARCODECOUNT = 0x1219;
        public const int DTWAIN_EI_BARCODECONFIDENCE = 0x121A;
        public const int DTWAIN_EI_BARCODEROTATION = 0x121B;
        public const int DTWAIN_EI_BARCODETEXTLENGTH = 0x121C;
        public const int DTWAIN_EI_DESHADECOUNT = 0x121D;
        public const int DTWAIN_EI_DESHADEBLACKCOUNTOLD = 0x121E;
        public const int DTWAIN_EI_DESHADEBLACKCOUNTNEW = 0x121F;
        public const int DTWAIN_EI_DESHADEBLACKRLMIN = 0x1220;
        public const int DTWAIN_EI_DESHADEBLACKRLMAX = 0x1221;
        public const int DTWAIN_EI_DESHADEWHITECOUNTOLD = 0x1222;
        public const int DTWAIN_EI_DESHADEWHITECOUNTNEW = 0x1223;
        public const int DTWAIN_EI_DESHADEWHITERLMIN = 0x1224;
        public const int DTWAIN_EI_DESHADEWHITERLAVE = 0x1225;
        public const int DTWAIN_EI_DESHADEWHITERLMAX = 0x1226;
        public const int DTWAIN_EI_BLACKSPECKLESREMOVED = 0x1227;
        public const int DTWAIN_EI_WHITESPECKLESREMOVED = 0x1228;
        public const int DTWAIN_EI_HORZLINECOUNT = 0x1229;
        public const int DTWAIN_EI_VERTLINECOUNT = 0x122A;
        public const int DTWAIN_EI_DESKEWSTATUS = 0x122B;
        public const int DTWAIN_EI_SKEWORIGINALANGLE = 0x122C;
        public const int DTWAIN_EI_SKEWFINALANGLE = 0x122D;
        public const int DTWAIN_EI_SKEWCONFIDENCE = 0x122E;
        public const int DTWAIN_EI_SKEWWINDOWX1 = 0x122F;
        public const int DTWAIN_EI_SKEWWINDOWY1 = 0x1230;
        public const int DTWAIN_EI_SKEWWINDOWX2 = 0x1231;
        public const int DTWAIN_EI_SKEWWINDOWY2 = 0x1232;
        public const int DTWAIN_EI_SKEWWINDOWX3 = 0x1233;
        public const int DTWAIN_EI_SKEWWINDOWY3 = 0x1234;
        public const int DTWAIN_EI_SKEWWINDOWX4 = 0x1235;
        public const int DTWAIN_EI_SKEWWINDOWY4 = 0x1236;
        public const int DTWAIN_EI_BOOKNAME = 0x1238;
        public const int DTWAIN_EI_CHAPTERNUMBER = 0x1239;
        public const int DTWAIN_EI_DOCUMENTNUMBER = 0x123A;
        public const int DTWAIN_EI_PAGENUMBER = 0x123B;
        public const int DTWAIN_EI_CAMERA = 0x123C;
        public const int DTWAIN_EI_FRAMENUMBER = 0x123D;
        public const int DTWAIN_EI_FRAME = 0x123E;
        public const int DTWAIN_EI_PIXELFLAVOR = 0x123F;
        public const int DTWAIN_EI_ICCPROFILE = 0x1240;
        public const int DTWAIN_EI_LASTSEGMENT = 0x1241;
        public const int DTWAIN_EI_SEGMENTNUMBER = 0x1242;
        public const int DTWAIN_EI_MAGDATA = 0x1243;
        public const int DTWAIN_EI_MAGTYPE = 0x1244;
        public const int DTWAIN_EI_PAGESIDE = 0x1245;
        public const int DTWAIN_EI_FILESYSTEMSOURCE = 0x1246;
        public const int DTWAIN_EI_IMAGEMERGED = 0x1247;
        public const int DTWAIN_EI_MAGDATALENGTH = 0x1248;
        public const int DTWAIN_EI_PAPERCOUNT = 0x1249;
        public const int DTWAIN_EI_PRINTERTEXT = 0x124A;
        public const int DTWAIN_EI_TWAINDIRECTMETADATA = 0x124B;
        public const int DTWAIN_EI_IAFIELDA_VALUE = 0x124C;
        public const int DTWAIN_EI_IAFIELDB_VALUE = 0x124D;
        public const int DTWAIN_EI_IAFIELDC_VALUE = 0x124E;
        public const int DTWAIN_EI_IAFIELDD_VALUE = 0x124F;
        public const int DTWAIN_EI_IAFIELDE_VALUE = 0x1250;
        public const int DTWAIN_EI_IALEVEL = 0x1251;
        public const int DTWAIN_EI_PRINTER = 0x1252;
        public const int DTWAIN_EI_BARCODETEXT2 = 0x1253;
        public const uint DTWAIN_LOG_DECODE_SOURCE = 0x1      ;
        public const uint DTWAIN_LOG_DECODE_DEST = 0x2        ;
        public const uint DTWAIN_LOG_DECODE_TWMEMREF = 0x4    ;
        public const uint DTWAIN_LOG_DECODE_TWEVENT = 0x8     ;
        public const uint DTWAIN_LOG_CALLSTACK = 0x10         ;
        public const uint DTWAIN_LOG_ISTWAINMSG = 0x20        ;
        public const uint DTWAIN_LOG_INITFAILURE = 0x40       ;
        public const uint DTWAIN_LOG_LOWLEVELTWAIN = 0x80     ;
        public const uint DTWAIN_LOG_DECODE_BITMAP = 0x100    ;
        public const uint DTWAIN_LOG_NOTIFICATIONS = 0x200    ;
        public const uint DTWAIN_LOG_MISCELLANEOUS = 0x400    ;
        public const uint DTWAIN_LOG_DTWAINERRORS = 0x800     ;
        public const uint DTWAIN_LOG_USEFILE = 0x10000        ;
        public const uint DTWAIN_LOG_SHOWEXCEPTIONS = 0x20000 ;
        public const uint DTWAIN_LOG_ERRORMSGBOX = 0x40000    ;
        public const uint DTWAIN_LOG_USEBUFFER = 0x80000      ;
        public const uint DTWAIN_LOG_FILEAPPEND = 0x100000    ;
        public const uint DTWAIN_LOG_USECALLBACK = 0x200000   ;
        public const uint DTWAIN_LOG_USECRLF = 0x400000       ;
        public const uint DTWAIN_LOG_CONSOLE = 0x800000       ;
        public const uint DTWAIN_LOG_DEBUGMONITOR = 0x1000000 ;
        public const uint DTWAIN_LOG_USEWINDOW = 0x2000000    ;
        public const uint DTWAIN_LOG_CREATEDIRECTORY = 0x04000000;
        public const uint DTWAIN_LOG_CONSOLEWITHHANDLER = (0x08000000 | DTWAIN_LOG_CONSOLE);
        public const uint DTWAIN_LOG_ALL = (DTWAIN_LOG_DECODE_SOURCE | DTWAIN_LOG_DECODE_DEST | DTWAIN_LOG_DECODE_TWEVENT | DTWAIN_LOG_DECODE_TWMEMREF | DTWAIN_LOG_CALLSTACK | DTWAIN_LOG_ISTWAINMSG | DTWAIN_LOG_INITFAILURE | DTWAIN_LOG_LOWLEVELTWAIN | DTWAIN_LOG_NOTIFICATIONS | DTWAIN_LOG_MISCELLANEOUS | DTWAIN_LOG_DTWAINERRORS | DTWAIN_LOG_DECODE_BITMAP);
        public const uint DTWAIN_LOG_ALL_APPEND = 0xFFFFFFFFU;
        public const uint DTWAIN_TEMPDIR_CREATEDIRECTORY = DTWAIN_LOG_CREATEDIRECTORY;
        public const int DTWAINGCD_RETURNHANDLE = 1;
        public const int DTWAINGCD_COPYDATA = 2;
        public const int DTWAIN_BYPOSITION = 0;
        public const int DTWAIN_BYID = 1;
        public const int DTWAINSCD_USEHANDLE = 1;
        public const int DTWAINSCD_USEDATA = 2;
        public const int DTWAIN_PAGEFAIL_RETRY = 1;
        public const int DTWAIN_PAGEFAIL_TERMINATE = 2;
        public const int DTWAIN_MAXRETRY_ATTEMPTS = 3;
        public const int DTWAIN_RETRY_FOREVER = (-1);
        public const int DTWAIN_PDF_NOSCALING = 128;
        public const int DTWAIN_PDF_FITPAGE = 256;
        public const int DTWAIN_PDF_VARIABLEPAGESIZE = 512;
        public const int DTWAIN_PDF_CUSTOMSIZE = 1024;
        public const int DTWAIN_PDF_USECOMPRESSION = 2048;
        public const int DTWAIN_PDF_CUSTOMSCALE = 4096;
        public const int DTWAIN_PDF_PIXELSPERMETERSIZE = 8192;
        public const uint DTWAIN_PDF_ALLOWPRINTING = 2052;
        public const uint DTWAIN_PDF_ALLOWMOD = 8;
        public const uint DTWAIN_PDF_ALLOWCOPY = 16;
        public const uint DTWAIN_PDF_ALLOWMODANNOTATIONS = 32;
        public const uint DTWAIN_PDF_ALLOWFILLIN = 256;
        public const uint DTWAIN_PDF_ALLOWEXTRACTION = 512;
        public const uint DTWAIN_PDF_ALLOWASSEMBLY = 1024;
        public const uint DTWAIN_PDF_ALLOWDEGRADEDPRINTING = 4;
        public const uint DTWAIN_PDF_ALLOWALL = 0xFFFFFFFCU;
        public const uint DTWAIN_PDF_ALLOWANYMOD = (DTWAIN_PDF_ALLOWMOD | DTWAIN_PDF_ALLOWFILLIN | DTWAIN_PDF_ALLOWMODANNOTATIONS | DTWAIN_PDF_ALLOWASSEMBLY);
        public const uint DTWAIN_PDF_ALLOWANYPRINTING = (DTWAIN_PDF_ALLOWPRINTING | DTWAIN_PDF_ALLOWDEGRADEDPRINTING);
        public const int DTWAIN_PDF_PORTRAIT = 0;
        public const int DTWAIN_PDF_LANDSCAPE = 1;
        public const int DTWAIN_PS_REGULAR = 0;
        public const int DTWAIN_PS_ENCAPSULATED = 1;
        public const int DTWAIN_BP_AUTODISCARD_NONE = 0;
        public const int DTWAIN_BP_AUTODISCARD_IMMEDIATE = 1;
        public const int DTWAIN_BP_AUTODISCARD_AFTERPROCESS = 2;
        public const int DTWAIN_BP_DETECTORIGINAL = 1;
        public const int DTWAIN_BP_DETECTADJUSTED = 2;
        public const int DTWAIN_BP_DETECTALL = (DTWAIN_BP_DETECTORIGINAL | DTWAIN_BP_DETECTADJUSTED);
        public const int DTWAIN_BP_DISABLE = (-2);
        public const int DTWAIN_BP_AUTO = (-1);
        public const uint DTWAIN_BP_AUTODISCARD_ANY = 0xFFFF;
        public const int DTWAIN_LP_REFLECTIVE = 0;
        public const int DTWAIN_LP_TRANSMISSIVE = 1;
        public const int DTWAIN_LS_RED = 0;
        public const int DTWAIN_LS_GREEN = 1;
        public const int DTWAIN_LS_BLUE = 2;
        public const int DTWAIN_LS_NONE = 3;
        public const int DTWAIN_LS_WHITE = 4;
        public const int DTWAIN_LS_UV = 5;
        public const int DTWAIN_LS_IR = 6;
        public const int DTWAIN_DLG_SORTNAMES = 1;
        public const int DTWAIN_DLG_CENTER = 2;
        public const int DTWAIN_DLG_CENTER_SCREEN = 4;
        public const int DTWAIN_DLG_USETEMPLATE = 8;
        public const int DTWAIN_DLG_CLEAR_PARAMS = 16;
        public const int DTWAIN_DLG_HORIZONTALSCROLL = 32;
        public const int DTWAIN_DLG_USEINCLUDENAMES = 64;
        public const int DTWAIN_DLG_USEEXCLUDENAMES = 128;
        public const int DTWAIN_DLG_USENAMEMAPPING = 256;
        public const int DTWAIN_DLG_TOPMOSTWINDOW = 1024;
        public const int DTWAIN_DLG_OPENONSELECT = 2048;
        public const int DTWAIN_DLG_NOOPENONSELECT = 4096;
        public const int DTWAIN_DLG_HIGHLIGHTFIRST = 8192;
        public const int DTWAIN_DLG_SAVELASTSCREENPOS = 16384;
        public const int DTWAIN_DLG_CENTER_CURRENT_MONITOR = 32768;
        public const int DTWAIN_DLG_CONSOLEASPARENT = 65536;
        public const int DTWAIN_RES_ENGLISH = 0;
        public const int DTWAIN_RES_FRENCH = 1;
        public const int DTWAIN_RES_SPANISH = 2;
        public const int DTWAIN_RES_DUTCH = 3;
        public const int DTWAIN_RES_GERMAN = 4;
        public const int DTWAIN_RES_ITALIAN = 5;
        public const int DTWAIN_AL_ALARM = 0;
        public const int DTWAIN_AL_FEEDERERROR = 1;
        public const int DTWAIN_AL_FEEDERWARNING = 2;
        public const int DTWAIN_AL_BARCODE = 3;
        public const int DTWAIN_AL_DOUBLEFEED = 4;
        public const int DTWAIN_AL_JAM = 5;
        public const int DTWAIN_AL_PATCHCODE = 6;
        public const int DTWAIN_AL_POWER = 7;
        public const int DTWAIN_AL_SKEW = 8;
        public const int DTWAIN_FT_CAMERA = 0;
        public const int DTWAIN_FT_CAMERATOP = 1;
        public const int DTWAIN_FT_CAMERABOTTOM = 2;
        public const int DTWAIN_FT_CAMERAPREVIEW = 3;
        public const int DTWAIN_FT_DOMAIN = 4;
        public const int DTWAIN_FT_HOST = 5;
        public const int DTWAIN_FT_DIRECTORY = 6;
        public const int DTWAIN_FT_IMAGE = 7;
        public const int DTWAIN_FT_UNKNOWN = 8;
        public const int DTWAIN_NF_NONE = 0;
        public const int DTWAIN_NF_AUTO = 1;
        public const int DTWAIN_NF_LONEPIXEL = 2;
        public const int DTWAIN_NF_MAJORITYRULE = 3;
        public const int DTWAIN_CB_AUTO = 0;
        public const int DTWAIN_CB_CLEAR = 1;
        public const int DTWAIN_CB_NOCLEAR = 2;
        public const int DTWAIN_FA_NONE = 0;
        public const int DTWAIN_FA_LEFT = 1;
        public const int DTWAIN_FA_CENTER = 2;
        public const int DTWAIN_FA_RIGHT = 3;
        public const int DTWAIN_PF_CHOCOLATE = 0;
        public const int DTWAIN_PF_VANILLA = 1;
        public const int DTWAIN_FO_FIRSTPAGEFIRST = 0;
        public const int DTWAIN_FO_LASTPAGEFIRST = 1;
        public const int DTWAIN_INCREMENT_STATIC = 0;
        public const int DTWAIN_INCREMENT_DYNAMIC = 1;
        public const int DTWAIN_INCREMENT_DEFAULT = -1;
        public const int DTWAIN_MANDUP_FACEUPTOPPAGE = 0;
        public const int DTWAIN_MANDUP_FACEUPBOTTOMPAGE = 1;
        public const int DTWAIN_MANDUP_FACEDOWNTOPPAGE = 2;
        public const int DTWAIN_MANDUP_FACEDOWNBOTTOMPAGE = 3;
        public const int DTWAIN_FILESAVE_DEFAULT = 0;
        public const int DTWAIN_FILESAVE_UICLOSE = 1;
        public const int DTWAIN_FILESAVE_SOURCECLOSE = 2;
        public const int DTWAIN_FILESAVE_ENDACQUIRE = 3;
        public const int DTWAIN_FILESAVE_MANUALSAVE = 4;
        public const int DTWAIN_FILESAVE_SAVEINCOMPLETE = 128;
        public const int DTWAIN_MANDUP_SCANOK = 1;
        public const int DTWAIN_MANDUP_SIDE1RESCAN = 2;
        public const int DTWAIN_MANDUP_SIDE2RESCAN = 3;
        public const int DTWAIN_MANDUP_RESCANALL = 4;
        public const int DTWAIN_MANDUP_PAGEMISSING = 5;
        public const int DTWAIN_DEMODLL_VERSION = 0x00000001;
        public const int DTWAIN_UNLICENSED_VERSION = 0x00000002;
        public const int DTWAIN_COMPANY_VERSION = 0x00000004;
        public const int DTWAIN_GENERAL_VERSION = 0x00000008;
        public const int DTWAIN_DEVELOP_VERSION = 0x00000010;
        public const int DTWAIN_JAVA_VERSION = 0x00000020;
        public const int DTWAIN_TOOLKIT_VERSION = 0x00000040;
        public const int DTWAIN_LIMITEDDLL_VERSION = 0x00000080;
        public const int DTWAIN_STATICLIB_VERSION = 0x00000100;
        public const int DTWAIN_STATICLIB_STDCALL_VERSION = 0x00000200;
        public const int DTWAIN_PDF_VERSION = 0x00010000;
        public const int DTWAIN_TWAINSAVE_VERSION = 0x00020000;
        public const int DTWAIN_OCR_VERSION = 0x00040000;
        public const int DTWAIN_BARCODE_VERSION = 0x00080000;
        public const int DTWAIN_ACTIVEX_VERSION = 0x00100000;
        public const int DTWAIN_32BIT_VERSION = 0x00200000;
        public const int DTWAIN_64BIT_VERSION = 0x00400000;
        public const int DTWAIN_UNICODE_VERSION = 0x00800000;
        public const int DTWAIN_OPENSOURCE_VERSION = 0x01000000;
        public const int DTWAIN_CALLSTACK_LOGGING = 0x02000000;
        public const int DTWAIN_CALLSTACK_LOGGING_PLUS = 0x04000000;
        public const int DTWAINOCR_RETURNHANDLE = 1;
        public const int DTWAINOCR_COPYDATA = 2;
        public const int DTWAIN_OCRINFO_CHAR = 0;
        public const int DTWAIN_OCRINFO_CHARXPOS = 1;
        public const int DTWAIN_OCRINFO_CHARYPOS = 2;
        public const int DTWAIN_OCRINFO_CHARXWIDTH = 3;
        public const int DTWAIN_OCRINFO_CHARYWIDTH = 4;
        public const int DTWAIN_OCRINFO_CHARCONFIDENCE = 5;
        public const int DTWAIN_OCRINFO_PAGENUM = 6;
        public const int DTWAIN_OCRINFO_OCRENGINE = 7;
        public const int DTWAIN_OCRINFO_TEXTLENGTH = 8;
        public const int DTWAIN_PDFPAGETYPE_COLOR = 0;
        public const int DTWAIN_PDFPAGETYPE_BW = 1;
        public const int DTWAIN_TWAINDSM_LEGACY = 1;
        public const int DTWAIN_TWAINDSM_VERSION2 = 2;
        public const int DTWAIN_TWAINDSM_LATESTVERSION = 4;
        public const int DTWAIN_TWAINDSMSEARCH_NOTFOUND = (-1);
        public const int DTWAIN_TWAINDSMSEARCH_WSO = 0;
        public const int DTWAIN_TWAINDSMSEARCH_WOS = 1;
        public const int DTWAIN_TWAINDSMSEARCH_SWO = 2;
        public const int DTWAIN_TWAINDSMSEARCH_SOW = 3;
        public const int DTWAIN_TWAINDSMSEARCH_OWS = 4;
        public const int DTWAIN_TWAINDSMSEARCH_OSW = 5;
        public const int DTWAIN_TWAINDSMSEARCH_W = 6;
        public const int DTWAIN_TWAINDSMSEARCH_S = 7;
        public const int DTWAIN_TWAINDSMSEARCH_O = 8;
        public const int DTWAIN_TWAINDSMSEARCH_WS = 9;
        public const int DTWAIN_TWAINDSMSEARCH_WO = 10;
        public const int DTWAIN_TWAINDSMSEARCH_SW = 11;
        public const int DTWAIN_TWAINDSMSEARCH_SO = 12;
        public const int DTWAIN_TWAINDSMSEARCH_OW = 13;
        public const int DTWAIN_TWAINDSMSEARCH_OS = 14;
        public const int DTWAIN_TWAINDSMSEARCH_C = 15;
        public const int DTWAIN_TWAINDSMSEARCH_U = 16;
        public const int DTWAIN_PDFPOLARITY_POSITIVE = 1;
        public const int DTWAIN_PDFPOLARITY_NEGATIVE = 2;
        public const int DTWAIN_TWPF_NORMAL = 0;
        public const int DTWAIN_TWPF_BOLD = 1;
        public const int DTWAIN_TWPF_ITALIC = 2;
        public const int DTWAIN_TWPF_LARGESIZE = 3;
        public const int DTWAIN_TWPF_SMALLSIZE = 4;
        public const int DTWAIN_TWCT_PAGE = 0;
        public const int DTWAIN_TWCT_PATCH1 = 1;
        public const int DTWAIN_TWCT_PATCH2 = 2;
        public const int DTWAIN_TWCT_PATCH3 = 3;
        public const int DTWAIN_TWCT_PATCH4 = 4;
        public const int DTWAIN_TWCT_PATCH5 = 5;
        public const int DTWAIN_TWCT_PATCH6 = 6;
        public const int DTWAIN_AUTOSIZE_NONE = 0;
        public const int DTWAIN_CV_CAPCUSTOMBASE = 0x8000;
        public const int DTWAIN_CV_CAPXFERCOUNT = 0x0001;
        public const int DTWAIN_CV_ICAPCOMPRESSION = 0x0100;
        public const int DTWAIN_CV_ICAPPIXELTYPE = 0x0101;
        public const int DTWAIN_CV_ICAPUNITS = 0x0102;
        public const int DTWAIN_CV_ICAPXFERMECH = 0x0103;
        public const int DTWAIN_CV_CAPAUTHOR = 0x1000;
        public const int DTWAIN_CV_CAPCAPTION = 0x1001;
        public const int DTWAIN_CV_CAPFEEDERENABLED = 0x1002;
        public const int DTWAIN_CV_CAPFEEDERLOADED = 0x1003;
        public const int DTWAIN_CV_CAPTIMEDATE = 0x1004;
        public const int DTWAIN_CV_CAPSUPPORTEDCAPS = 0x1005;
        public const int DTWAIN_CV_CAPEXTENDEDCAPS = 0x1006;
        public const int DTWAIN_CV_CAPAUTOFEED = 0x1007;
        public const int DTWAIN_CV_CAPCLEARPAGE = 0x1008;
        public const int DTWAIN_CV_CAPFEEDPAGE = 0x1009;
        public const int DTWAIN_CV_CAPREWINDPAGE = 0x100a;
        public const int DTWAIN_CV_CAPINDICATORS = 0x100b;
        public const int DTWAIN_CV_CAPSUPPORTEDCAPSEXT = 0x100c;
        public const int DTWAIN_CV_CAPPAPERDETECTABLE = 0x100d;
        public const int DTWAIN_CV_CAPUICONTROLLABLE = 0x100e;
        public const int DTWAIN_CV_CAPDEVICEONLINE = 0x100f;
        public const int DTWAIN_CV_CAPAUTOSCAN = 0x1010;
        public const int DTWAIN_CV_CAPTHUMBNAILSENABLED = 0x1011;
        public const int DTWAIN_CV_CAPDUPLEX = 0x1012;
        public const int DTWAIN_CV_CAPDUPLEXENABLED = 0x1013;
        public const int DTWAIN_CV_CAPENABLEDSUIONLY = 0x1014;
        public const int DTWAIN_CV_CAPCUSTOMDSDATA = 0x1015;
        public const int DTWAIN_CV_CAPENDORSER = 0x1016;
        public const int DTWAIN_CV_CAPJOBCONTROL = 0x1017;
        public const int DTWAIN_CV_CAPALARMS = 0x1018;
        public const int DTWAIN_CV_CAPALARMVOLUME = 0x1019;
        public const int DTWAIN_CV_CAPAUTOMATICCAPTURE = 0x101a;
        public const int DTWAIN_CV_CAPTIMEBEFOREFIRSTCAPTURE = 0x101b;
        public const int DTWAIN_CV_CAPTIMEBETWEENCAPTURES = 0x101c;
        public const int DTWAIN_CV_CAPCLEARBUFFERS = 0x101d;
        public const int DTWAIN_CV_CAPMAXBATCHBUFFERS = 0x101e;
        public const int DTWAIN_CV_CAPDEVICETIMEDATE = 0x101f;
        public const int DTWAIN_CV_CAPPOWERSUPPLY = 0x1020;
        public const int DTWAIN_CV_CAPCAMERAPREVIEWUI = 0x1021;
        public const int DTWAIN_CV_CAPDEVICEEVENT = 0x1022;
        public const int DTWAIN_CV_CAPPAGEMULTIPLEACQUIRE = 0x1023;
        public const int DTWAIN_CV_CAPSERIALNUMBER = 0x1024;
        public const int DTWAIN_CV_CAPFILESYSTEM = 0x1025;
        public const int DTWAIN_CV_CAPPRINTER = 0x1026;
        public const int DTWAIN_CV_CAPPRINTERENABLED = 0x1027;
        public const int DTWAIN_CV_CAPPRINTERINDEX = 0x1028;
        public const int DTWAIN_CV_CAPPRINTERMODE = 0x1029;
        public const int DTWAIN_CV_CAPPRINTERSTRING = 0x102a;
        public const int DTWAIN_CV_CAPPRINTERSUFFIX = 0x102b;
        public const int DTWAIN_CV_CAPLANGUAGE = 0x102c;
        public const int DTWAIN_CV_CAPFEEDERALIGNMENT = 0x102d;
        public const int DTWAIN_CV_CAPFEEDERORDER = 0x102e;
        public const int DTWAIN_CV_CAPPAPERBINDING = 0x102f;
        public const int DTWAIN_CV_CAPREACQUIREALLOWED = 0x1030;
        public const int DTWAIN_CV_CAPPASSTHRU = 0x1031;
        public const int DTWAIN_CV_CAPBATTERYMINUTES = 0x1032;
        public const int DTWAIN_CV_CAPBATTERYPERCENTAGE = 0x1033;
        public const int DTWAIN_CV_CAPPOWERDOWNTIME = 0x1034;
        public const int DTWAIN_CV_CAPSEGMENTED = 0x1035;
        public const int DTWAIN_CV_CAPCAMERAENABLED = 0x1036;
        public const int DTWAIN_CV_CAPCAMERAORDER = 0x1037;
        public const int DTWAIN_CV_CAPMICRENABLED = 0x1038;
        public const int DTWAIN_CV_CAPFEEDERPREP = 0x1039;
        public const int DTWAIN_CV_CAPFEEDERPOCKET = 0x103a;
        public const int DTWAIN_CV_CAPAUTOMATICSENSEMEDIUM = 0x103b;
        public const int DTWAIN_CV_CAPCUSTOMINTERFACEGUID = 0x103c;
        public const int DTWAIN_CV_CAPSUPPORTEDCAPSSEGMENTUNIQUE = 0x103d;
        public const int DTWAIN_CV_CAPSUPPORTEDDATS = 0x103e;
        public const int DTWAIN_CV_CAPDOUBLEFEEDDETECTION = 0x103f;
        public const int DTWAIN_CV_CAPDOUBLEFEEDDETECTIONLENGTH = 0x1040;
        public const int DTWAIN_CV_CAPDOUBLEFEEDDETECTIONSENSITIVITY = 0x1041;
        public const int DTWAIN_CV_CAPDOUBLEFEEDDETECTIONRESPONSE = 0x1042;
        public const int DTWAIN_CV_CAPPAPERHANDLING = 0x1043;
        public const int DTWAIN_CV_CAPINDICATORSMODE = 0x1044;
        public const int DTWAIN_CV_CAPPRINTERVERTICALOFFSET = 0x1045;
        public const int DTWAIN_CV_CAPPOWERSAVETIME = 0x1046;
        public const int DTWAIN_CV_CAPPRINTERCHARROTATION = 0x1047;
        public const int DTWAIN_CV_CAPPRINTERFONTSTYLE = 0x1048;
        public const int DTWAIN_CV_CAPPRINTERINDEXLEADCHAR = 0x1049;
        public const int DTWAIN_CV_CAPIMAGEADDRESSENABLED = 0x1050;
        public const int DTWAIN_CV_CAPIAFIELDA_LEVEL = 0x1051;
        public const int DTWAIN_CV_CAPIAFIELDB_LEVEL = 0x1052;
        public const int DTWAIN_CV_CAPIAFIELDC_LEVEL = 0x1053;
        public const int DTWAIN_CV_CAPIAFIELDD_LEVEL = 0x1054;
        public const int DTWAIN_CV_CAPIAFIELDE_LEVEL = 0x1055;
        public const int DTWAIN_CV_CAPIAFIELDA_PRINTFORMAT = 0x1056;
        public const int DTWAIN_CV_CAPIAFIELDB_PRINTFORMAT = 0x1057;
        public const int DTWAIN_CV_CAPIAFIELDC_PRINTFORMAT = 0x1058;
        public const int DTWAIN_CV_CAPIAFIELDD_PRINTFORMAT = 0x1059;
        public const int DTWAIN_CV_CAPIAFIELDE_PRINTFORMAT = 0x105A;
        public const int DTWAIN_CV_CAPIAFIELDA_VALUE = 0x105B;
        public const int DTWAIN_CV_CAPIAFIELDB_VALUE = 0x105C;
        public const int DTWAIN_CV_CAPIAFIELDC_VALUE = 0x105D;
        public const int DTWAIN_CV_CAPIAFIELDD_VALUE = 0x105E;
        public const int DTWAIN_CV_CAPIAFIELDE_VALUE = 0x105F;
        public const int DTWAIN_CV_CAPIAFIELDA_LASTPAGE = 0x1060;
        public const int DTWAIN_CV_CAPIAFIELDB_LASTPAGE = 0x1061;
        public const int DTWAIN_CV_CAPIAFIELDC_LASTPAGE = 0x1062;
        public const int DTWAIN_CV_CAPIAFIELDD_LASTPAGE = 0x1063;
        public const int DTWAIN_CV_CAPIAFIELDE_LASTPAGE = 0x1064;
        public const int DTWAIN_CV_CAPPRINTERINDEXMAXVALUE = 0x104A;
        public const int DTWAIN_CV_CAPPRINTERINDEXNUMDIGITS = 0x104B;
        public const int DTWAIN_CV_CAPPRINTERINDEXSTEP = 0x104C;
        public const int DTWAIN_CV_CAPPRINTERINDEXTRIGGER = 0x104D;
        public const int DTWAIN_CV_CAPPRINTERSTRINGPREVIEW = 0x104E;
        public const int DTWAIN_CV_ICAPAUTOBRIGHT = 0x1100;
        public const int DTWAIN_CV_ICAPBRIGHTNESS = 0x1101;
        public const int DTWAIN_CV_ICAPCONTRAST = 0x1103;
        public const int DTWAIN_CV_ICAPCUSTHALFTONE = 0x1104;
        public const int DTWAIN_CV_ICAPEXPOSURETIME = 0x1105;
        public const int DTWAIN_CV_ICAPFILTER = 0x1106;
        public const int DTWAIN_CV_ICAPFLASHUSED = 0x1107;
        public const int DTWAIN_CV_ICAPGAMMA = 0x1108;
        public const int DTWAIN_CV_ICAPHALFTONES = 0x1109;
        public const int DTWAIN_CV_ICAPHIGHLIGHT = 0x110a;
        public const int DTWAIN_CV_ICAPIMAGEFILEFORMAT = 0x110c;
        public const int DTWAIN_CV_ICAPLAMPSTATE = 0x110d;
        public const int DTWAIN_CV_ICAPLIGHTSOURCE = 0x110e;
        public const int DTWAIN_CV_ICAPORIENTATION = 0x1110;
        public const int DTWAIN_CV_ICAPPHYSICALWIDTH = 0x1111;
        public const int DTWAIN_CV_ICAPPHYSICALHEIGHT = 0x1112;
        public const int DTWAIN_CV_ICAPSHADOW = 0x1113;
        public const int DTWAIN_CV_ICAPFRAMES = 0x1114;
        public const int DTWAIN_CV_ICAPXNATIVERESOLUTION = 0x1116;
        public const int DTWAIN_CV_ICAPYNATIVERESOLUTION = 0x1117;
        public const int DTWAIN_CV_ICAPXRESOLUTION = 0x1118;
        public const int DTWAIN_CV_ICAPYRESOLUTION = 0x1119;
        public const int DTWAIN_CV_ICAPMAXFRAMES = 0x111a;
        public const int DTWAIN_CV_ICAPTILES = 0x111b;
        public const int DTWAIN_CV_ICAPBITORDER = 0x111c;
        public const int DTWAIN_CV_ICAPCCITTKFACTOR = 0x111d;
        public const int DTWAIN_CV_ICAPLIGHTPATH = 0x111e;
        public const int DTWAIN_CV_ICAPPIXELFLAVOR = 0x111f;
        public const int DTWAIN_CV_ICAPPLANARCHUNKY = 0x1120;
        public const int DTWAIN_CV_ICAPROTATION = 0x1121;
        public const int DTWAIN_CV_ICAPSUPPORTEDSIZES = 0x1122;
        public const int DTWAIN_CV_ICAPTHRESHOLD = 0x1123;
        public const int DTWAIN_CV_ICAPXSCALING = 0x1124;
        public const int DTWAIN_CV_ICAPYSCALING = 0x1125;
        public const int DTWAIN_CV_ICAPBITORDERCODES = 0x1126;
        public const int DTWAIN_CV_ICAPPIXELFLAVORCODES = 0x1127;
        public const int DTWAIN_CV_ICAPJPEGPIXELTYPE = 0x1128;
        public const int DTWAIN_CV_ICAPTIMEFILL = 0x112a;
        public const int DTWAIN_CV_ICAPBITDEPTH = 0x112b;
        public const int DTWAIN_CV_ICAPBITDEPTHREDUCTION = 0x112c;
        public const int DTWAIN_CV_ICAPUNDEFINEDIMAGESIZE = 0x112d;
        public const int DTWAIN_CV_ICAPIMAGEDATASET = 0x112e;
        public const int DTWAIN_CV_ICAPEXTIMAGEINFO = 0x112f;
        public const int DTWAIN_CV_ICAPMINIMUMHEIGHT = 0x1130;
        public const int DTWAIN_CV_ICAPMINIMUMWIDTH = 0x1131;
        public const int DTWAIN_CV_ICAPAUTOBORDERDETECTION = 0x1132;
        public const int DTWAIN_CV_ICAPAUTODESKEW = 0x1133;
        public const int DTWAIN_CV_ICAPAUTODISCARDBLANKPAGES = 0x1134;
        public const int DTWAIN_CV_ICAPAUTOROTATE = 0x1135;
        public const int DTWAIN_CV_ICAPFLIPROTATION = 0x1136;
        public const int DTWAIN_CV_ICAPBARCODEDETECTIONENABLED = 0x1137;
        public const int DTWAIN_CV_ICAPSUPPORTEDBARCODETYPES = 0x1138;
        public const int DTWAIN_CV_ICAPBARCODEMAXSEARCHPRIORITIES = 0x1139;
        public const int DTWAIN_CV_ICAPBARCODESEARCHPRIORITIES = 0x113a;
        public const int DTWAIN_CV_ICAPBARCODESEARCHMODE = 0x113b;
        public const int DTWAIN_CV_ICAPBARCODEMAXRETRIES = 0x113c;
        public const int DTWAIN_CV_ICAPBARCODETIMEOUT = 0x113d;
        public const int DTWAIN_CV_ICAPZOOMFACTOR = 0x113e;
        public const int DTWAIN_CV_ICAPPATCHCODEDETECTIONENABLED = 0x113f;
        public const int DTWAIN_CV_ICAPSUPPORTEDPATCHCODETYPES = 0x1140;
        public const int DTWAIN_CV_ICAPPATCHCODEMAXSEARCHPRIORITIES = 0x1141;
        public const int DTWAIN_CV_ICAPPATCHCODESEARCHPRIORITIES = 0x1142;
        public const int DTWAIN_CV_ICAPPATCHCODESEARCHMODE = 0x1143;
        public const int DTWAIN_CV_ICAPPATCHCODEMAXRETRIES = 0x1144;
        public const int DTWAIN_CV_ICAPPATCHCODETIMEOUT = 0x1145;
        public const int DTWAIN_CV_ICAPFLASHUSED2 = 0x1146;
        public const int DTWAIN_CV_ICAPIMAGEFILTER = 0x1147;
        public const int DTWAIN_CV_ICAPNOISEFILTER = 0x1148;
        public const int DTWAIN_CV_ICAPOVERSCAN = 0x1149;
        public const int DTWAIN_CV_ICAPAUTOMATICBORDERDETECTION = 0x1150;
        public const int DTWAIN_CV_ICAPAUTOMATICDESKEW = 0x1151;
        public const int DTWAIN_CV_ICAPAUTOMATICROTATE = 0x1152;
        public const int DTWAIN_CV_ICAPJPEGQUALITY = 0x1153;
        public const int DTWAIN_CV_ICAPFEEDERTYPE = 0x1154;
        public const int DTWAIN_CV_ICAPICCPROFILE = 0x1155;
        public const int DTWAIN_CV_ICAPAUTOSIZE = 0x1156;
        public const int DTWAIN_CV_ICAPAUTOMATICCROPUSESFRAME = 0x1157;
        public const int DTWAIN_CV_ICAPAUTOMATICLENGTHDETECTION = 0x1158;
        public const int DTWAIN_CV_ICAPAUTOMATICCOLORENABLED = 0x1159;
        public const int DTWAIN_CV_ICAPAUTOMATICCOLORNONCOLORPIXELTYPE = 0x115a;
        public const int DTWAIN_CV_ICAPCOLORMANAGEMENTENABLED = 0x115b;
        public const int DTWAIN_CV_ICAPIMAGEMERGE = 0x115c;
        public const int DTWAIN_CV_ICAPIMAGEMERGEHEIGHTTHRESHOLD = 0x115d;
        public const int DTWAIN_CV_ICAPSUPPORTEDEXTIMAGEINFO = 0x115e;
        public const int DTWAIN_CV_ICAPFILMTYPE = 0x115f;
        public const int DTWAIN_CV_ICAPMIRROR = 0x1160;
        public const int DTWAIN_CV_ICAPJPEGSUBSAMPLING = 0x1161;
        public const int DTWAIN_CV_ACAPAUDIOFILEFORMAT = 0x1201;
        public const int DTWAIN_CV_ACAPXFERMECH = 0x1202;
        public const int DTWAIN_CFMCV_CAPCFMSTART = 2048;
        public const int DTWAIN_CFMCV_CAPDUPLEXSCANNER = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+10);
        public const int DTWAIN_CFMCV_CAPDUPLEXENABLE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+11);
        public const int DTWAIN_CFMCV_CAPSCANNERNAME = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+12);
        public const int DTWAIN_CFMCV_CAPSINGLEPASS = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+13);
        public const int DTWAIN_CFMCV_CAPERRHANDLING = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+20);
        public const int DTWAIN_CFMCV_CAPFEEDERSTATUS = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+21);
        public const int DTWAIN_CFMCV_CAPFEEDMEDIUMWAIT = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+22);
        public const int DTWAIN_CFMCV_CAPFEEDWAITTIME = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+23);
        public const int DTWAIN_CFMCV_ICAPWHITEBALANCE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+24);
        public const int DTWAIN_CFMCV_ICAPAUTOBINARY = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+25);
        public const int DTWAIN_CFMCV_ICAPIMAGESEPARATION = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+26);
        public const int DTWAIN_CFMCV_ICAPHARDWARECOMPRESSION = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+27);
        public const int DTWAIN_CFMCV_ICAPIMAGEEMPHASIS = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+28);
        public const int DTWAIN_CFMCV_ICAPOUTLINING = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+29);
        public const int DTWAIN_CFMCV_ICAPDYNTHRESHOLD = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+30);
        public const int DTWAIN_CFMCV_ICAPVARIANCE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+31);
        public const int DTWAIN_CFMCV_CAPENDORSERAVAILABLE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+32);
        public const int DTWAIN_CFMCV_CAPENDORSERENABLE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+33);
        public const int DTWAIN_CFMCV_CAPENDORSERCHARSET = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+34);
        public const int DTWAIN_CFMCV_CAPENDORSERSTRINGLENGTH = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+35);
        public const int DTWAIN_CFMCV_CAPENDORSERSTRING = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+36);
        public const int DTWAIN_CFMCV_ICAPDYNTHRESHOLDCURVE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+48);
        public const int DTWAIN_CFMCV_ICAPSMOOTHINGMODE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+49);
        public const int DTWAIN_CFMCV_ICAPFILTERMODE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+50);
        public const int DTWAIN_CFMCV_ICAPGRADATION = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+51);
        public const int DTWAIN_CFMCV_ICAPMIRROR = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+52);
        public const int DTWAIN_CFMCV_ICAPEASYSCANMODE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+53);
        public const int DTWAIN_CFMCV_ICAPSOFTWAREINTERPOLATION = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+54);
        public const int DTWAIN_CFMCV_ICAPIMAGESEPARATIONEX = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+55);
        public const int DTWAIN_CFMCV_CAPDUPLEXPAGE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+56);
        public const int DTWAIN_CFMCV_ICAPINVERTIMAGE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+57);
        public const int DTWAIN_CFMCV_ICAPSPECKLEREMOVE = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+58);
        public const int DTWAIN_CFMCV_ICAPUSMFILTER = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+59);
        public const int DTWAIN_CFMCV_ICAPNOISEFILTERCFM = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+60);
        public const int DTWAIN_CFMCV_ICAPDESCREENING = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+61);
        public const int DTWAIN_CFMCV_ICAPQUALITYFILTER = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+62);
        public const int DTWAIN_CFMCV_ICAPBINARYFILTER = (DTWAIN_CV_CAPCUSTOMBASE+DTWAIN_CFMCV_CAPCFMSTART+63);
        public const int DTWAIN_OCRCV_IMAGEFILEFORMAT = 0x1000;
        public const int DTWAIN_OCRCV_DESKEW = 0x1001;
        public const int DTWAIN_OCRCV_DESHADE = 0x1002;
        public const int DTWAIN_OCRCV_ORIENTATION = 0x1003;
        public const int DTWAIN_OCRCV_NOISEREMOVE = 0x1004;
        public const int DTWAIN_OCRCV_LINEREMOVE = 0x1005;
        public const int DTWAIN_OCRCV_INVERTPAGE = 0x1006;
        public const int DTWAIN_OCRCV_INVERTZONES = 0x1007;
        public const int DTWAIN_OCRCV_LINEREJECT = 0x1008;
        public const int DTWAIN_OCRCV_CHARACTERREJECT = 0x1009;
        public const int DTWAIN_OCRCV_ERRORREPORTMODE = 0x1010;
        public const int DTWAIN_OCRCV_ERRORREPORTFILE = 0x1011;
        public const int DTWAIN_OCRCV_PIXELTYPE = 0x1012;
        public const int DTWAIN_OCRCV_BITDEPTH = 0x1013;
        public const int DTWAIN_OCRCV_RETURNCHARINFO = 0x1014;
        public const int DTWAIN_OCRCV_NATIVEFILEFORMAT = 0x1015;
        public const int DTWAIN_OCRCV_MPNATIVEFILEFORMAT = 0x1016;
        public const int DTWAIN_OCRCV_SUPPORTEDCAPS = 0x1017;
        public const int DTWAIN_OCRCV_DISABLECHARACTERS = 0x1018;
        public const int DTWAIN_OCRCV_REMOVECONTROLCHARS = 0x1019;
        public const int DTWAIN_OCRORIENT_OFF = 0;
        public const int DTWAIN_OCRORIENT_AUTO = 1;
        public const int DTWAIN_OCRORIENT_90 = 2;
        public const int DTWAIN_OCRORIENT_180 = 3;
        public const int DTWAIN_OCRORIENT_270 = 4;
        public const int DTWAIN_OCRIMAGEFORMAT_AUTO = 10000;
        public const int DTWAIN_OCRERROR_MODENONE = 0;
        public const int DTWAIN_OCRERROR_SHOWMSGBOX = 1;
        public const int DTWAIN_OCRERROR_WRITEFILE = 2;
        public const int DTWAIN_PDFTEXT_ALLPAGES = 0x00000001;
        public const int DTWAIN_PDFTEXT_EVENPAGES = 0x00000002;
        public const int DTWAIN_PDFTEXT_ODDPAGES = 0x00000004;
        public const int DTWAIN_PDFTEXT_FIRSTPAGE = 0x00000008;
        public const int DTWAIN_PDFTEXT_LASTPAGE = 0x00000010;
        public const int DTWAIN_PDFTEXT_CURRENTPAGE = 0x00000020;
        public const int DTWAIN_PDFTEXT_DISABLED = 0x00000040;
        public const int DTWAIN_PDFTEXT_TOPLEFT = 0x00000100;
        public const int DTWAIN_PDFTEXT_TOPRIGHT = 0x00000200;
        public const int DTWAIN_PDFTEXT_HORIZCENTER = 0x00000400;
        public const int DTWAIN_PDFTEXT_VERTCENTER = 0x00000800;
        public const int DTWAIN_PDFTEXT_BOTTOMLEFT = 0x00001000;
        public const int DTWAIN_PDFTEXT_BOTTOMRIGHT = 0x00002000;
        public const int DTWAIN_PDFTEXT_BOTTOMCENTER = 0x00004000;
        public const int DTWAIN_PDFTEXT_TOPCENTER = 0x00008000;
        public const int DTWAIN_PDFTEXT_XCENTER = 0x00010000;
        public const int DTWAIN_PDFTEXT_YCENTER = 0x00020000;
        public const int DTWAIN_PDFTEXT_NOSCALING = 0x00100000;
        public const int DTWAIN_PDFTEXT_NOCHARSPACING = 0x00200000;
        public const int DTWAIN_PDFTEXT_NOWORDSPACING = 0x00400000;
        public const int DTWAIN_PDFTEXT_NOSTROKEWIDTH = 0x00800000;
        public const int DTWAIN_PDFTEXT_NORENDERMODE = 0x01000000;
        public const int DTWAIN_PDFTEXT_NORGBCOLOR = 0x02000000;
        public const int DTWAIN_PDFTEXT_NOFONTSIZE = 0x04000000;
        public const int DTWAIN_PDFTEXT_NOABSPOSITION = 0x08000000;
        public const int DTWAIN_PDFTEXT_NOROTATION = 0x10000000;
        public const int DTWAIN_PDFTEXT_NOSKEWING = 0x20000000;
        public const int DTWAIN_PDFTEXT_NOSCALINGXY = 0x40000000;
        public const uint DTWAIN_PDFTEXT_IGNOREALL = 0xFFF00000U;
        public const int DTWAIN_FONT_COURIER = 0;
        public const int DTWAIN_FONT_COURIERBOLD = 1;
        public const int DTWAIN_FONT_COURIERBOLDOBLIQUE = 2;
        public const int DTWAIN_FONT_COURIEROBLIQUE = 3;
        public const int DTWAIN_FONT_HELVETICA = 4;
        public const int DTWAIN_FONT_HELVETICABOLD = 5;
        public const int DTWAIN_FONT_HELVETICABOLDOBLIQUE = 6;
        public const int DTWAIN_FONT_HELVETICAOBLIQUE = 7;
        public const int DTWAIN_FONT_TIMESBOLD = 8;
        public const int DTWAIN_FONT_TIMESBOLDITALIC = 9;
        public const int DTWAIN_FONT_TIMESROMAN = 10;
        public const int DTWAIN_FONT_TIMESITALIC = 11;
        public const int DTWAIN_FONT_SYMBOL = 12;
        public const int DTWAIN_FONT_ZAPFDINGBATS = 13;
        public const int DTWAIN_PDFRENDER_FILL = 0;
        public const int DTWAIN_PDFRENDER_STROKE = 1;
        public const int DTWAIN_PDFRENDER_FILLSTROKE = 2;
        public const int DTWAIN_PDFRENDER_INVISIBLE = 3;
        public const int DTWAIN_PDFTEXTELEMENT_SCALINGXY = 0;
        public const int DTWAIN_PDFTEXTELEMENT_FONTHEIGHT = 1;
        public const int DTWAIN_PDFTEXTELEMENT_WORDSPACING = 2;
        public const int DTWAIN_PDFTEXTELEMENT_POSITION = 3;
        public const int DTWAIN_PDFTEXTELEMENT_COLOR = 4;
        public const int DTWAIN_PDFTEXTELEMENT_STROKEWIDTH = 5;
        public const int DTWAIN_PDFTEXTELEMENT_DISPLAYFLAGS = 6;
        public const int DTWAIN_PDFTEXTELEMENT_FONTNAME = 7;
        public const int DTWAIN_PDFTEXTELEMENT_TEXT = 8;
        public const int DTWAIN_PDFTEXTELEMENT_RENDERMODE = 9;
        public const int DTWAIN_PDFTEXTELEMENT_CHARSPACING = 10;
        public const int DTWAIN_PDFTEXTELEMENT_ROTATIONANGLE = 11;
        public const int DTWAIN_PDFTEXTELEMENT_LEADING = 12;
        public const int DTWAIN_PDFTEXTELEMENT_SCALING = 13;
        public const int DTWAIN_PDFTEXTELEMENT_TEXTLENGTH = 14;
        public const int DTWAIN_PDFTEXTELEMENT_SKEWANGLES = 15;
        public const int DTWAIN_PDFTEXTELEMENT_TRANSFORMORDER = 16;
        public const int DTWAIN_PDFTEXTTRANSFORM_SRK = 0;
        public const int DTWAIN_PDFTEXTTRANSFORM_SKR = 1;
        public const int DTWAIN_PDFTEXTTRANSFORM_KSR = 2;
        public const int DTWAIN_PDFTEXTTRANSFORM_KRS = 3;
        public const int DTWAIN_PDFTEXTTRANSFORM_RSK = 4;
        public const int DTWAIN_PDFTEXTTRANSFORM_RKS = 5;
        public const int DTWAIN_PDFTEXTTRANFORM_LAST = DTWAIN_PDFTEXTTRANSFORM_RKS;
        public const int DTWAIN_TWDF_ULTRASONIC = 0;
        public const int DTWAIN_TWDF_BYLENGTH = 1;
        public const int DTWAIN_TWDF_INFRARED = 2;
        public const int DTWAIN_TWAS_NONE = 0;
        public const int DTWAIN_TWAS_AUTO = 1;
        public const int DTWAIN_TWAS_CURRENT = 2;
        public const int DTWAIN_TWFR_BOOK = 0;
        public const int DTWAIN_TWFR_FANFOLD = 1;
        public const int DTWAIN_CONSTANT_TWPT = 0 ;
        public const int DTWAIN_CONSTANT_TWUN = 1 ;
        public const int DTWAIN_CONSTANT_TWCY = 2 ;
        public const int DTWAIN_CONSTANT_TWAL = 3 ;
        public const int DTWAIN_CONSTANT_TWAS = 4 ;
        public const int DTWAIN_CONSTANT_TWBCOR = 5 ;
        public const int DTWAIN_CONSTANT_TWBD = 6 ;
        public const int DTWAIN_CONSTANT_TWBO = 7 ;
        public const int DTWAIN_CONSTANT_TWBP = 8 ;
        public const int DTWAIN_CONSTANT_TWBR = 9 ;
        public const int DTWAIN_CONSTANT_TWBT = 10;
        public const int DTWAIN_CONSTANT_TWCP = 11;
        public const int DTWAIN_CONSTANT_TWCS = 12;
        public const int DTWAIN_CONSTANT_TWDE = 13;
        public const int DTWAIN_CONSTANT_TWDR = 14;
        public const int DTWAIN_CONSTANT_TWDSK = 15;
        public const int DTWAIN_CONSTANT_TWDX = 16;
        public const int DTWAIN_CONSTANT_TWFA = 17;
        public const int DTWAIN_CONSTANT_TWFE = 18;
        public const int DTWAIN_CONSTANT_TWFF = 19;
        public const int DTWAIN_CONSTANT_TWFL = 20;
        public const int DTWAIN_CONSTANT_TWFO = 21;
        public const int DTWAIN_CONSTANT_TWFP = 22;
        public const int DTWAIN_CONSTANT_TWFR = 23;
        public const int DTWAIN_CONSTANT_TWFT = 24;
        public const int DTWAIN_CONSTANT_TWFY = 25;
        public const int DTWAIN_CONSTANT_TWIA = 26;
        public const int DTWAIN_CONSTANT_TWIC = 27;
        public const int DTWAIN_CONSTANT_TWIF = 28;
        public const int DTWAIN_CONSTANT_TWIM = 29;
        public const int DTWAIN_CONSTANT_TWJC = 30;
        public const int DTWAIN_CONSTANT_TWJQ = 31;
        public const int DTWAIN_CONSTANT_TWLP = 32;
        public const int DTWAIN_CONSTANT_TWLS = 33;
        public const int DTWAIN_CONSTANT_TWMD = 34;
        public const int DTWAIN_CONSTANT_TWNF = 35;
        public const int DTWAIN_CONSTANT_TWOR = 36;
        public const int DTWAIN_CONSTANT_TWOV = 37;
        public const int DTWAIN_CONSTANT_TWPA = 38;
        public const int DTWAIN_CONSTANT_TWPC = 39;
        public const int DTWAIN_CONSTANT_TWPCH = 40;
        public const int DTWAIN_CONSTANT_TWPF = 41;
        public const int DTWAIN_CONSTANT_TWPM = 42;
        public const int DTWAIN_CONSTANT_TWPR = 43;
        public const int DTWAIN_CONSTANT_TWPF2 = 44;
        public const int DTWAIN_CONSTANT_TWCT = 45;
        public const int DTWAIN_CONSTANT_TWPS = 46;
        public const int DTWAIN_CONSTANT_TWSS = 47;
        public const int DTWAIN_CONSTANT_TWPH = 48;
        public const int DTWAIN_CONSTANT_TWCI = 49;
        public const int DTWAIN_CONSTANT_FONTNAME = 50;
        public const int DTWAIN_CONSTANT_TWEI = 51;
        public const int DTWAIN_CONSTANT_TWEJ = 52;
        public const int DTWAIN_CONSTANT_TWCC = 53;
        public const int DTWAIN_CONSTANT_TWQC = 54;
        public const int DTWAIN_CONSTANT_TWRC = 55;
        public const int DTWAIN_CONSTANT_MSG = 56;
        public const int DTWAIN_CONSTANT_TWLG = 57;
        public const int DTWAIN_CONSTANT_DLLINFO = 58;
        public const int DTWAIN_CONSTANT_DG = 59;
        public const int DTWAIN_CONSTANT_DAT = 60;
        public const int DTWAIN_CONSTANT_DF = 61;
        public const int DTWAIN_CONSTANT_TWTY = 62;
        public const int DTWAIN_CONSTANT_TWCB = 63;
        public const int DTWAIN_CONSTANT_TWAF = 64;
        public const int DTWAIN_CONSTANT_TWFS = 65;
        public const int DTWAIN_CONSTANT_TWJS = 66;
        public const int DTWAIN_CONSTANT_TWMR = 67;
        public const int DTWAIN_CONSTANT_TWDP = 68;
        public const int DTWAIN_CONSTANT_TWUS = 69;
        public const int DTWAIN_CONSTANT_TWDF = 70;
        public const int DTWAIN_CONSTANT_TWFM = 71;
        public const int DTWAIN_CONSTANT_TWSG = 72;
        public const int DTWAIN_CONSTANT_DTWAIN_TN = 73;
        public const int DTWAIN_CONSTANT_TWON = 74;
        public const int DTWAIN_CONSTANT_TWMF = 75;
        public const int DTWAIN_CONSTANT_TWSX = 76;
        public const int DTWAIN_CONSTANT_CAP = 77;
        public const int DTWAIN_CONSTANT_ICAP = 78;
        public const int DTWAIN_CONSTANT_DTWAIN_CONT = 79;
        public const int DTWAIN_CONSTANT_CAPCODE_MAP = 80;
        public const int DTWAIN_CONSTANT_ACAP = 81;
        public const int DTWAIN_CONSTANT_CAPCODE_NOMNEMONIC = 82;
        public const int DTWAIN_CONSTANT_DTWAINCONT_TWAINCONT = 83;
        public const int DTWAIN_CONSTANT_ERROR_NAMES = 84;
        public const int DTWAIN_USERRES_START = 20000;
        public const int DTWAIN_USERRES_MAXSIZE = 8192;
        public const int DTWAIN_APIHANDLEOK = 1;
        public const int DTWAIN_TWAINSESSIONOK = 2;
        public const int DTWAIN_PDF_AES128 = 1;
        public const int DTWAIN_PDF_AES256 = 2;
        public const int DTWAIN_FEEDER_TERMINATE = 1;
        public const int DTWAIN_FEEDER_USEFLATBED = 2;

        public const string DTWAIN_LIBRARY = "dtwain32ud.dll";

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AcquireAudioFile(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string lpszFile, int lFileFlags, int lMaxClips, int bShowUI, int bCloseSource, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_AcquireAudioNative(DTWAIN_SOURCE Source, int nMaxAudioClips, int bShowUI, int bCloseSource, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AcquireAudioNativeEx(DTWAIN_SOURCE Source, int nMaxAudioClips, int bShowUI, int bCloseSource, DTWAIN_ARRAY Acquisitions, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_AcquireBuffered(DTWAIN_SOURCE Source, int PixelType, int nMaxPages, int bShowUI, int bCloseSource, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AcquireBufferedEx(DTWAIN_SOURCE Source, int PixelType, int nMaxPages, int bShowUI, int bCloseSource, DTWAIN_ARRAY Acquisitions, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AcquireFile(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string lpszFile, int lFileType, int lFileFlags, int PixelType, int lMaxPages, int bShowUI, int bCloseSource, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AcquireFileEx(DTWAIN_SOURCE Source, DTWAIN_ARRAY aFileNames, int lFileType, int lFileFlags, int PixelType, int lMaxPages, int bShowUI, int bCloseSource, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_AcquireNative(DTWAIN_SOURCE Source, int PixelType, int nMaxPages, int bShowUI, int bCloseSource, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AcquireNativeEx(DTWAIN_SOURCE Source, int PixelType, int nMaxPages, int bShowUI, int bCloseSource, DTWAIN_ARRAY Acquisitions, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_AcquireToClipboard(DTWAIN_SOURCE Source, int PixelType, int nMaxPages, int nTransferMode, int bDiscardDibs, int bShowUI, int bCloseSource, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AddExtImageInfoQuery(DTWAIN_SOURCE Source, int ExtImageInfo);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AddFileToAppend([MarshalAs(UnmanagedType.LPTStr)] string szFile);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AddPDFText(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string szText, int xPos, int yPos, [MarshalAs(UnmanagedType.LPTStr)] string fontName, DTWAIN_FLOAT fontSize, int colorRGB, int renderMode, DTWAIN_FLOAT scaling, DTWAIN_FLOAT charSpacing, DTWAIN_FLOAT wordSpacing, DTWAIN_FLOAT strokeWidth, uint Flags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AddPDFTextElement(DTWAIN_SOURCE Source, DTWAIN_PDFTEXTELEMENT TextElement);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AddPDFTextEx(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string szText, int xPos, int yPos, [MarshalAs(UnmanagedType.LPTStr)] string fontName, DTWAIN_FLOAT fontSize, int colorRGB, int renderMode, DTWAIN_FLOAT scaling, DTWAIN_FLOAT charSpacing, DTWAIN_FLOAT wordSpacing, DTWAIN_FLOAT strokeWidth, DTWAIN_FLOAT rotationAngle, DTWAIN_FLOAT skewAngleX, DTWAIN_FLOAT skewAngleY, DTWAIN_FLOAT scalingX, DTWAIN_FLOAT scalingY, int transformType);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AddPDFTextString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string szText, int xPos, int yPos, [MarshalAs(UnmanagedType.LPTStr)] string fontName, [MarshalAs(UnmanagedType.LPTStr)] string fontSize, int colorRGB, int renderMode, [MarshalAs(UnmanagedType.LPTStr)] string scaling, [MarshalAs(UnmanagedType.LPTStr)] string charSpacing, [MarshalAs(UnmanagedType.LPTStr)] string wordSpacing, [MarshalAs(UnmanagedType.LPTStr)] string strokeWidth, uint Flags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_AllocateMemory(uint memSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_AllocateMemory64(ULONG64 memSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_AllocateMemoryEx(uint memSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_AppHandlesExceptions(int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayANSIStringToFloat(DTWAIN_ARRAY StringArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAdd(DTWAIN_ARRAY pArray, System.IntPtr pVariant);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddANSIString(DTWAIN_ARRAY pArray, string Val);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddANSIStringN(DTWAIN_ARRAY pArray, string Val, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddFloat(DTWAIN_ARRAY pArray, DTWAIN_FLOAT Val);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddFloatN(DTWAIN_ARRAY pArray, DTWAIN_FLOAT Val, int num);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddFloatString(DTWAIN_ARRAY pArray, [MarshalAs(UnmanagedType.LPTStr)] string Val);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddFloatStringN(DTWAIN_ARRAY pArray, [MarshalAs(UnmanagedType.LPTStr)] string Val, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddFrame(DTWAIN_ARRAY pArray, DTWAIN_FRAME frame);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddFrameN(DTWAIN_ARRAY pArray, DTWAIN_FRAME frame, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddLong(DTWAIN_ARRAY pArray, int Val);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddLong64(DTWAIN_ARRAY pArray, LONG64 Val);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddLong64N(DTWAIN_ARRAY pArray, LONG64 Val, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddLongN(DTWAIN_ARRAY pArray, int Val, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddN(DTWAIN_ARRAY pArray, System.IntPtr pVariant, int num);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddString(DTWAIN_ARRAY pArray, [MarshalAs(UnmanagedType.LPTStr)] string Val);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddStringN(DTWAIN_ARRAY pArray, [MarshalAs(UnmanagedType.LPTStr)] string Val, int num);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddWideString(DTWAIN_ARRAY pArray, string Val);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayAddWideStringN(DTWAIN_ARRAY pArray, string Val, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayConvertFix32ToFloat(DTWAIN_ARRAY Fix32Array);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayConvertFloatToFix32(DTWAIN_ARRAY FloatArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayCopy(DTWAIN_ARRAY Source, DTWAIN_ARRAY Dest);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayCreate(int nEnumType, int nInitialSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayCreateCopy(DTWAIN_ARRAY Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayCreateFromCap(DTWAIN_SOURCE Source, int lCapType, int lSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayCreateFromLong64s(ref long pCArray, int nSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayCreateFromLongs(ref int pCArray, int nSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayCreateFromReals(ref DTWAIN_FLOAT pCArray, int nSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayDestroy(DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayDestroyFrames(DTWAIN_ARRAY FrameArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayDumpToLog(DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFind(DTWAIN_ARRAY pArray, System.IntPtr pVariant);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFindANSIString(DTWAIN_ARRAY pArray, string pString);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFindFloat(DTWAIN_ARRAY pArray, DTWAIN_FLOAT Val, DTWAIN_FLOAT Tolerance);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFindFloatString(DTWAIN_ARRAY pArray, [MarshalAs(UnmanagedType.LPTStr)] string Val, [MarshalAs(UnmanagedType.LPTStr)] string Tolerance);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFindLong(DTWAIN_ARRAY pArray, int Val);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFindLong64(DTWAIN_ARRAY pArray, LONG64 Val);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFindString(DTWAIN_ARRAY pArray, [MarshalAs(UnmanagedType.LPTStr)] string pString);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFindWideString(DTWAIN_ARRAY pArray, string pString);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFix32GetAt(DTWAIN_ARRAY aFix32, int lPos, ref int Whole, ref int Frac);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayFix32SetAt(DTWAIN_ARRAY aFix32, int lPos, int Whole, int Frac);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayFloatToANSIString(DTWAIN_ARRAY FloatArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayFloatToString(DTWAIN_ARRAY FloatArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayFloatToWideString(DTWAIN_ARRAY FloatArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAt(DTWAIN_ARRAY pArray, int nWhere, System.IntPtr pVariant);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtANSIString(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPStr)] System.Text.StringBuilder pStr);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtFloat(DTWAIN_ARRAY pArray, int nWhere, ref DTWAIN_FLOAT pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_FLOAT DTWAIN_ArrayGetAtFloatEx(DTWAIN_ARRAY pArray, int nWhere);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtFloatString(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Val);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtFloatString(DTWAIN_ARRAY pArray, int nWhere, System.IntPtr Val);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtFrame(DTWAIN_ARRAY FrameArray, int nWhere, ref DTWAIN_FLOAT pleft, ref DTWAIN_FLOAT ptop, ref DTWAIN_FLOAT pright, ref DTWAIN_FLOAT pbottom);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtFrameEx(DTWAIN_ARRAY FrameArray, int nWhere, DTWAIN_FRAME Frame);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtFrameString(DTWAIN_ARRAY FrameArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder left, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder top, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder right, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder bottom);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtFrameString(DTWAIN_ARRAY FrameArray, int nWhere, System.IntPtr left, System.IntPtr top, System.IntPtr right, System.IntPtr bottom);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtLong(DTWAIN_ARRAY pArray, int nWhere, ref int pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtLong64(DTWAIN_ARRAY pArray, int nWhere, ref long pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern LONG64 DTWAIN_ArrayGetAtLong64Ex(DTWAIN_ARRAY pArray, int nWhere);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtLongEx(DTWAIN_ARRAY pArray, int nWhere);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtSource(DTWAIN_ARRAY pArray, int nWhere, ref DTWAIN_SOURCE ppSource);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_SOURCE DTWAIN_ArrayGetAtSourceEx(DTWAIN_ARRAY pArray, int nWhere);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtString(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder pStr);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtString(DTWAIN_ARRAY pArray, int nWhere, System.IntPtr pStr);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetAtWideString(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder pStr);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern System.IntPtr DTWAIN_ArrayGetBuffer(DTWAIN_ARRAY pArray, int nPos);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayGetCapValues(DTWAIN_SOURCE Source, int lCap, int lGetType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayGetCapValuesEx(DTWAIN_SOURCE Source, int lCap, int lGetType, int lContainerType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayGetCapValuesEx2(DTWAIN_SOURCE Source, int lCap, int lGetType, int lContainerType, int nDataType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetCount(DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetMaxStringLength(DTWAIN_ARRAY a);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetSourceAt(DTWAIN_ARRAY pArray, int nWhere, ref DTWAIN_SOURCE ppSource);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetStringLength(DTWAIN_ARRAY a, int nWhichString);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayGetType(DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayInit();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAt(DTWAIN_ARRAY pArray, int nWhere, System.IntPtr pVariant);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtANSIString(DTWAIN_ARRAY pArray, int nWhere, string pVal);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtANSIStringN(DTWAIN_ARRAY pArray, int nWhere, string Val, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtFloat(DTWAIN_ARRAY pArray, int nWhere, DTWAIN_FLOAT pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtFloatN(DTWAIN_ARRAY pArray, int nWhere, DTWAIN_FLOAT Val, int num);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtFloatString(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] string Val);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtFloatStringN(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] string Val, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtFrame(DTWAIN_ARRAY pArray, int nWhere, DTWAIN_FRAME frame);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtFrameN(DTWAIN_ARRAY pArray, int nWhere, DTWAIN_FRAME frame, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtLong(DTWAIN_ARRAY pArray, int nWhere, int pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtLong64(DTWAIN_ARRAY pArray, int nWhere, LONG64 Val);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtLong64N(DTWAIN_ARRAY pArray, int nWhere, LONG64 Val, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtLongN(DTWAIN_ARRAY pArray, int nWhere, int pVal, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtN(DTWAIN_ARRAY pArray, int nWhere, System.IntPtr pVariant, int num);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtString(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] string pVal);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtStringN(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] string Val, int num);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtWideString(DTWAIN_ARRAY pArray, int nWhere, string pVal);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayInsertAtWideStringN(DTWAIN_ARRAY pArray, int nWhere, string Val, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayRemoveAll(DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayRemoveAt(DTWAIN_ARRAY pArray, int nWhere);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayRemoveAtN(DTWAIN_ARRAY pArray, int nWhere, int num);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArrayResize(DTWAIN_ARRAY pArray, int NewSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAt(DTWAIN_ARRAY pArray, int lPos, System.IntPtr pVariant);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtANSIString(DTWAIN_ARRAY pArray, int nWhere, string pStr);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtFloat(DTWAIN_ARRAY pArray, int nWhere, DTWAIN_FLOAT pVal);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtFloatString(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] string Val);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtFrame(DTWAIN_ARRAY FrameArray, int nWhere, DTWAIN_FLOAT left, DTWAIN_FLOAT top, DTWAIN_FLOAT right, DTWAIN_FLOAT bottom);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtFrameEx(DTWAIN_ARRAY FrameArray, int nWhere, DTWAIN_FRAME Frame);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtFrameString(DTWAIN_ARRAY FrameArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] string left, [MarshalAs(UnmanagedType.LPTStr)] string top, [MarshalAs(UnmanagedType.LPTStr)] string right, [MarshalAs(UnmanagedType.LPTStr)] string bottom);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtLong(DTWAIN_ARRAY pArray, int nWhere, int pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtLong64(DTWAIN_ARRAY pArray, int nWhere, LONG64 Val);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtString(DTWAIN_ARRAY pArray, int nWhere, [MarshalAs(UnmanagedType.LPTStr)] string pStr);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ArraySetAtWideString(DTWAIN_ARRAY pArray, int nWhere, string pStr);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayStringToFloat(DTWAIN_ARRAY StringArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_ArrayWideStringToFloat(DTWAIN_ARRAY StringArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_CallCallback(int wParam, int lParam, int UserData);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_CallCallback64(int wParam, int lParam, LONGLONG UserData);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_CallDSMProc(DTWAIN_IDENTITY AppID, DTWAIN_IDENTITY SourceId, int lDG, int lDAT, int lMSG, System.IntPtr pData);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_CheckHandles(int bCheck);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ClearBuffers(DTWAIN_SOURCE Source, int ClearBuffer);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ClearErrorBuffer();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ClearPDFTextElements(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ClearPage(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_CloseSource(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_CloseSourceUI(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_ConvertDIBToBitmap(HANDLE hDib, HANDLE hPalette);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_ConvertDIBToFullBitmap(HANDLE hDib, int isBMP);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_ConvertToAPIString([MarshalAs(UnmanagedType.LPTStr)] string lpOrigString);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ConvertToAPIStringEx([MarshalAs(UnmanagedType.LPTStr)] string lpOrigString, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpOutString, int nSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ConvertToAPIStringEx([MarshalAs(UnmanagedType.LPTStr)] string lpOrigString, System.IntPtr lpOutString, int nSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_CreateAcquisitionArray();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_PDFTEXTELEMENT DTWAIN_CreatePDFTextElement();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_PDFTEXTELEMENT DTWAIN_CreatePDFTextElementCopy(DTWAIN_PDFTEXTELEMENT TextElement);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_DeleteDIB(HANDLE hDib);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_DestroyAcquisitionArray(DTWAIN_ARRAY aAcq, int bDestroyData);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_DestroyPDFTextElement(DTWAIN_PDFTEXTELEMENT TextElement);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_DisableAppWindow(HWND hWnd, int bDisable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableAutoBorderDetect(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableAutoBright(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableAutoDeskew(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableAutoFeed(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableAutoRotate(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableAutoScan(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableAutomaticSenseMedium(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableBarcodeDetection(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableDuplex(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableFeeder(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableGetMessageLoop(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableGetMessageLoopDetection(int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableIndicator(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableJobFileHandling(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableLamp(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableMsgNotify(int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnablePatchcodeDetection(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnablePeekMessageLoop(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnablePrinter(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableThumbnail(DTWAIN_SOURCE Source, int bEnable);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnableTripletsNotify(int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EndThread(DTWAIN_HANDLE DLLHandle);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EndTwainSession();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumAlarmVolumes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int expandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumAlarmVolumesEx(DTWAIN_SOURCE Source, int expandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumAlarms(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumAlarmsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumAudioXferMechs(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumAudioXferMechsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumAutoFeedValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumAutoFeedValuesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumAutomaticCaptures(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumAutomaticCapturesEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumAutomaticSenseMedium(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumAutomaticSenseMediumEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumBarcodeCodes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY PCodes);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBarcodeCodesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumBarcodeMaxPriorities(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBarcodeMaxPrioritiesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumBarcodeMaxRetries(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBarcodeMaxRetriesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumBarcodePriorities(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBarcodePrioritiesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumBarcodeSearchModes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBarcodeSearchModesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumBarcodeTimeOutValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBarcodeTimeOutValuesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumBitDepths(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBitDepthsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBitDepthsEx2(DTWAIN_SOURCE Source, int PixelType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumBottomCameras(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY Cameras);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBottomCamerasEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumBrightnessValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumBrightnessValuesEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumCameras(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY Cameras);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumCamerasEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumCamerasEx2(DTWAIN_SOURCE Source, int nWhichCamera);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumCapLabels(int lCapability);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumCompressionTypes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumCompressionTypesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumCompressionTypesEx2(DTWAIN_SOURCE Source, int lFileType, int bUseBufferedMode);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumContrastValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumContrastValuesEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumCustomCaps(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumCustomCapsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumDoubleFeedDetectLengths(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumDoubleFeedDetectLengthsEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumDoubleFeedDetectValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumDoubleFeedDetectValuesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumExtImageInfoTypes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumExtImageInfoTypesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumExtendedCaps(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumExtendedCapsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumExtendedCapsEx2(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumFileTypeBitsPerPixel(int FileType, ref DTWAIN_ARRAY Array);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumFileXferFormats(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumFileXferFormatsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumHalftones(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumHalftonesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumHighlightValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumHighlightValuesEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumJobControls(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumJobControlsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumLightPaths(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY LightPath);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumLightPathsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumLightSources(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY LightSources);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumLightSourcesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumMaxBuffers(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pMaxBufs, int bExpandRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumMaxBuffersEx(DTWAIN_SOURCE Source, int bExpandRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumNoiseFilters(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumNoiseFiltersEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumOCRInterfaces(ref DTWAIN_ARRAY OCRInterfaces);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumOCRInterfacesEx();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumOCRSupportedCaps(DTWAIN_OCRENGINE Engine, ref DTWAIN_ARRAY SupportedCaps);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumOrientations(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumOrientationsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumOverscanValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumOverscanValuesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumPaperSizes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumPaperSizesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumPatchcodeCodes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY PCodes);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumPatchcodeCodesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumPatchcodeMaxPriorities(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumPatchcodeMaxPrioritiesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumPatchcodeMaxRetries(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumPatchcodeMaxRetriesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumPatchcodePriorities(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumPatchcodePrioritiesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumPatchcodeSearchModes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumPatchcodeSearchModesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumPatchcodeTimeOutValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumPatchcodeTimeOutValuesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumPixelTypes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumPixelTypesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumPrinterStringModes(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumPrinterStringModesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumResolutionValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumResolutionValuesEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumShadowValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumShadowValuesEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumSourceUnits(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY lpArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumSourceUnitsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumSourceValues(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string capName, ref DTWAIN_ARRAY values, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumSources(ref DTWAIN_ARRAY lpArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumSourcesEx();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumSupportedCaps(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumSupportedCapsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumSupportedCapsEx2(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumSupportedExtImageInfo(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumSupportedExtImageInfoEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumSupportedFileTypes();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumSupportedMultiPageFileTypes();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumSupportedSinglePageFileTypes();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumThresholdValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumThresholdValuesEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumTopCameras(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY Cameras);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumTopCamerasEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumTwainPrinters(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY lpAvailPrinters);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumTwainPrintersEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumXResolutionValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumXResolutionValuesEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_EnumYResolutionValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_EnumYResolutionValuesEx(DTWAIN_SOURCE Source, int bExpandIfRange);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ExecuteOCR(DTWAIN_OCRENGINE Engine, [MarshalAs(UnmanagedType.LPTStr)] string szFileName, int nStartPage, int nEndPage);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FeedPage(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FlipBitmap(HANDLE hDib);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FlushAcquiredPages(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_FRAME DTWAIN_FrameCreate(DTWAIN_FLOAT Left, DTWAIN_FLOAT Top, DTWAIN_FLOAT Right, DTWAIN_FLOAT Bottom);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_FRAME DTWAIN_FrameCreateString([MarshalAs(UnmanagedType.LPTStr)] string Left, [MarshalAs(UnmanagedType.LPTStr)] string Top, [MarshalAs(UnmanagedType.LPTStr)] string Right, [MarshalAs(UnmanagedType.LPTStr)] string Bottom);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameDestroy(DTWAIN_FRAME Frame);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameGetAll(DTWAIN_FRAME Frame, ref DTWAIN_FLOAT Left, ref DTWAIN_FLOAT Top, ref DTWAIN_FLOAT Right, ref DTWAIN_FLOAT Bottom);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameGetAllString(DTWAIN_FRAME Frame, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Left, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Top, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Right, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Bottom);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameGetAllString(DTWAIN_FRAME Frame, System.IntPtr Left, System.IntPtr Top, System.IntPtr Right, System.IntPtr Bottom);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameGetValue(DTWAIN_FRAME Frame, int nWhich, ref DTWAIN_FLOAT Value);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameGetValueString(DTWAIN_FRAME Frame, int nWhich, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Value);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameGetValueString(DTWAIN_FRAME Frame, int nWhich, System.IntPtr Value);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameIsValid(DTWAIN_FRAME Frame);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameSetAll(DTWAIN_FRAME Frame, DTWAIN_FLOAT Left, DTWAIN_FLOAT Top, DTWAIN_FLOAT Right, DTWAIN_FLOAT Bottom);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameSetAllString(DTWAIN_FRAME Frame, [MarshalAs(UnmanagedType.LPTStr)] string Left, [MarshalAs(UnmanagedType.LPTStr)] string Top, [MarshalAs(UnmanagedType.LPTStr)] string Right, [MarshalAs(UnmanagedType.LPTStr)] string Bottom);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameSetValue(DTWAIN_FRAME Frame, int nWhich, DTWAIN_FLOAT Value);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FrameSetValueString(DTWAIN_FRAME Frame, int nWhich, [MarshalAs(UnmanagedType.LPTStr)] string Value);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FreeExtImageInfo(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FreeMemory(HANDLE h);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_FreeMemoryEx(HANDLE h);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAPIHandleStatus(DTWAIN_HANDLE pHandle);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAcquireArea(DTWAIN_SOURCE Source, int lGetType, ref DTWAIN_ARRAY FloatEnum);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAcquireArea2(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT left, ref DTWAIN_FLOAT top, ref DTWAIN_FLOAT right, ref DTWAIN_FLOAT bottom, ref int lpUnit);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAcquireArea2String(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder left, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder top, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder right, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder bottom, ref int Unit);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAcquireArea2String(DTWAIN_SOURCE Source, System.IntPtr left, System.IntPtr top, System.IntPtr right, System.IntPtr bottom, ref int Unit);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_GetAcquireAreaEx(DTWAIN_SOURCE Source, int lGetType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAcquireMetrics(DTWAIN_SOURCE source, ref int ImageCount, ref int SheetCount);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_GetAcquireStripBuffer(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAcquireStripData(DTWAIN_SOURCE Source, ref int lpCompression, ref DWORD lpBytesPerRow, ref DWORD lpColumns, ref DWORD lpRows, ref DWORD XOffset, ref DWORD YOffset, ref DWORD lpBytesWritten);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAcquireStripSizes(DTWAIN_SOURCE Source, ref DWORD lpMin, ref DWORD lpMax, ref DWORD lpPreferred);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_GetAcquiredImage(DTWAIN_ARRAY aAcq, int nWhichAcq, int nWhichDib);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_GetAcquiredImageArray(DTWAIN_ARRAY aAcq, int nWhichAcq);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_GetAcquisitionArray(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetActiveDSMPath([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetActiveDSMPath(System.IntPtr lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetActiveDSMVersionInfo([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szDLLInfo, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetActiveDSMVersionInfo(System.IntPtr szDLLInfo, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAlarmVolume(DTWAIN_SOURCE Source, ref int lpVolume);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_GetAllSourceDibs(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAppInfo([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szVerStr, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szManu, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szProdFam, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szProdName);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAppInfo(System.IntPtr szVerStr, System.IntPtr szManu, System.IntPtr szProdFam, System.IntPtr szProdName);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAuthor(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szAuthor);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetAuthor(DTWAIN_SOURCE Source, System.IntPtr szAuthor);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBarcodeMaxPriorities(DTWAIN_SOURCE Source, ref int pMaxPriorities, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBarcodeMaxRetries(DTWAIN_SOURCE Source, ref int pMaxRetries, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBarcodePriorities(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY SearchPriorities);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBarcodeSearchMode(DTWAIN_SOURCE Source, ref int pSearchMode, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBarcodeTimeOut(DTWAIN_SOURCE Source, ref int pTimeOut, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBatteryMinutes(DTWAIN_SOURCE Source, ref int lpMinutes);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBatteryPercent(DTWAIN_SOURCE Source, ref int lpPercent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBitDepth(DTWAIN_SOURCE Source, ref int BitDepth, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBitDepthEx(DTWAIN_SOURCE Source, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBlankPageAutoDetection(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBrightness(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Brightness);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_FLOAT DTWAIN_GetBrightnessEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBrightnessString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Brightness);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetBrightnessString(DTWAIN_SOURCE Source, System.IntPtr Brightness);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_GetBufferedTransferInfo(DTWAIN_SOURCE Source, ref DWORD Compression, ref DWORD BytesPerRow, ref DWORD Columns, ref DWORD Rows, ref DWORD XOffset, ref DWORD YOffset, ref DWORD Flags, ref DWORD BytesWritten, ref DWORD MemoryLength);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTwainCallback DTWAIN_GetCallback();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTwainCallback64 DTWAIN_GetCallback64();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapArrayType(DTWAIN_SOURCE Source, int nCap);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapContainer(DTWAIN_SOURCE Source, int nCap, int lCapType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapContainerEx(int nCap, int bSetContainer, ref DTWAIN_ARRAY ConTypes);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_GetCapContainerEx2(int nCap, int bSetContainer);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapDataType(DTWAIN_SOURCE Source, int nCap);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapFromName([MarshalAs(UnmanagedType.LPTStr)] string szName);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapHelp(int lCapability, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszOut, int nSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapHelp(int lCapability, System.IntPtr lpszOut, int nSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapLabel(int lCapability, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszOut, int nSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapLabel(int lCapability, System.IntPtr lpszOut, int nSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapOperations(DTWAIN_SOURCE Source, int lCapability, ref int lpOps);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapOperationsEx(DTWAIN_SOURCE Source, int lCapability);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapValues(DTWAIN_SOURCE Source, int lCap, int lGetType, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapValuesEx(DTWAIN_SOURCE Source, int lCap, int lGetType, int lContainerType, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCapValuesEx2(DTWAIN_SOURCE Source, int lCap, int lGetType, int lContainerType, int nDataType, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCaption(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Caption);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCaption(DTWAIN_SOURCE Source, System.IntPtr Caption);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCompressionSize(DTWAIN_SOURCE Source, ref int lBytes);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCompressionType(DTWAIN_SOURCE Source, ref int lpCompression, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCompressionTypeEx(DTWAIN_SOURCE Source, int bCurrent);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetConditionCodeString(int lError, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetConditionCodeString(int lError, System.IntPtr lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetConstantFromTwainName([MarshalAs(UnmanagedType.LPTStr)] string lpszBuffer);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetContrast(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Contrast);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_FLOAT DTWAIN_GetContrastEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetContrastString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Contrast);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetContrastString(DTWAIN_SOURCE Source, System.IntPtr Contrast);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCountry();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_GetCurrentAcquiredImage(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCurrentFileName(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szName, int MaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCurrentFileName(DTWAIN_SOURCE Source, System.IntPtr szName, int MaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCurrentPageNum(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCurrentRetryCount(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetCurrentTwainTriplet([In, Out] TW_IDENTITY pAppID, [In, Out] TW_IDENTITY pSourceID, ref int lpDG, ref int lpDAT, ref int lpMsg, ref long lpMemRef);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_GetCustomDSData(DTWAIN_SOURCE Source, byte[] Data, uint dSize, ref DWORD pActualSize, int nFlags);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDSMFullName(int DSMType, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szDLLName, int nMaxLen, ref int pWhichSearch);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDSMFullName(int DSMType, System.IntPtr szDLLName, int nMaxLen, ref int pWhichSearch);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDSMSearchOrder();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDSMSearchOrderEx([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder SearchOrder, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder UserDirectory);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDSMSearchOrderEx(System.IntPtr SearchOrder, System.IntPtr UserDirectory);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_HANDLE DTWAIN_GetDTWAINHandle();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDeviceEvent(DTWAIN_SOURCE Source, ref int lpEvent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDeviceEventEx(DTWAIN_SOURCE Source, ref int lpEvent, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDeviceEventInfo(DTWAIN_SOURCE Source, int nWhichInfo, System.IntPtr pValue);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDeviceNotifications(DTWAIN_SOURCE Source, ref int DevEvents);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDeviceTimeDate(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szTimeDate);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDeviceTimeDate(DTWAIN_SOURCE Source, System.IntPtr szTimeDate);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDoubleFeedDetectLength(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Value, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDoubleFeedDetectValues(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDuplexType(DTWAIN_SOURCE Source, ref int lpDupType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetDuplexTypeEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetErrorBuffer(ref DTWAIN_ARRAY ArrayBuffer);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetErrorBufferThreshold();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTwainErrorProc DTWAIN_GetErrorCallback();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTwainErrorProc64 DTWAIN_GetErrorCallback64();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetErrorString(int lError, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetErrorString(int lError, System.IntPtr lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetExtCapFromName([MarshalAs(UnmanagedType.LPTStr)] string szName);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetExtImageInfo(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetExtImageInfoData(DTWAIN_SOURCE Source, int nWhich, ref DTWAIN_ARRAY Data);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_GetExtImageInfoDataEx(DTWAIN_SOURCE Source, int nWhich);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetExtImageInfoItem(DTWAIN_SOURCE Source, int nWhich, ref int InfoID, ref int NumItems, ref int Type);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetExtImageInfoItemEx(DTWAIN_SOURCE Source, int nWhich, ref int InfoID, ref int NumItems, ref int Type, ref int ReturnCode);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetExtNameFromCap(int nValue, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szValue, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetExtNameFromCap(int nValue, System.IntPtr szValue, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFeederAlignment(DTWAIN_SOURCE Source, ref int lpAlignment);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFeederFuncs(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFeederOrder(DTWAIN_SOURCE Source, ref int lpOrder);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFeederWaitTime(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFileCompressionType(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFileSavePageCount(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFileTypeExtensions(int nType, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszName, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFileTypeExtensions(int nType, System.IntPtr lpszName, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFileTypeName(int nType, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszName, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetFileTypeName(int nType, System.IntPtr lpszName, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetHalftone(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpHalftone, int GetType);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetHalftone(DTWAIN_SOURCE Source, System.IntPtr lpHalftone, int GetType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetHighlight(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Highlight);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetHighlightString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Highlight);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetHighlightString(DTWAIN_SOURCE Source, System.IntPtr Highlight);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetImageInfo(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT lpXResolution, ref DTWAIN_FLOAT lpYResolution, ref int lpWidth, ref int lpLength, ref int lpNumSamples, ref DTWAIN_ARRAY lpBitsPerSample, ref int lpBitsPerPixel, ref int lpPlanar, ref int lpPixelType, ref int lpCompression);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetImageInfoString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpXResolution, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpYResolution, ref int lpWidth, ref int lpLength, ref int lpNumSamples, ref DTWAIN_ARRAY lpBitsPerSample, ref int lpBitsPerPixel, ref int lpPlanar, ref int lpPixelType, ref int lpCompression);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetImageInfoString(DTWAIN_SOURCE Source, System.IntPtr lpXResolution, System.IntPtr lpYResolution, ref int lpWidth, ref int lpLength, ref int lpNumSamples, ref DTWAIN_ARRAY lpBitsPerSample, ref int lpBitsPerPixel, ref int lpPlanar, ref int lpPixelType, ref int lpCompression);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetJobControl(DTWAIN_SOURCE Source, ref int pJobControl, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetJobControlEx(DTWAIN_SOURCE Source, int bGetCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetJpegValues(DTWAIN_SOURCE Source, ref int pQuality, ref int Progressive);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetJpegXRValues(DTWAIN_SOURCE Source, ref int pQuality, ref int Progressive);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetLanguage();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetLastError();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetLibraryPath([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszVer, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetLibraryPath(System.IntPtr lpszVer, int nLength);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetLightPath(DTWAIN_SOURCE Source, ref int lpLightPath);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetLightPathEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetLightSource(DTWAIN_SOURCE Source, ref int LightSource);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetLightSources(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY LightSources);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_GetLightSourcesEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTwainLoggerProc DTWAIN_GetLoggerCallback();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetManualDuplexCount(DTWAIN_SOURCE Source, ref int pSide1, ref int pSide2);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetMaxAcquisitions(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetMaxBuffers(DTWAIN_SOURCE Source, ref int pMaxBuf);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetMaxPagesToAcquire(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetMaxRetryAttempts(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetNameFromCap(int nCapValue, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szValue, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetNameFromCap(int nCapValue, System.IntPtr szValue, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetNoiseFilter(DTWAIN_SOURCE Source, ref int lpNoiseFilter);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetNumAcquiredImages(DTWAIN_ARRAY aAcq, int nWhich);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetNumAcquisitions(DTWAIN_ARRAY aAcq);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRCapValues(DTWAIN_OCRENGINE Engine, int OCRCapValue, int GetType, ref DTWAIN_ARRAY CapValues);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRErrorString(DTWAIN_OCRENGINE Engine, int lError, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRErrorString(DTWAIN_OCRENGINE Engine, int lError, System.IntPtr lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRLastError(DTWAIN_OCRENGINE Engine);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRMajorMinorVersion(DTWAIN_OCRENGINE Engine, ref int lpMajor, ref int lpMinor);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRManufacturer(DTWAIN_OCRENGINE Engine, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szManufacturer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRManufacturer(DTWAIN_OCRENGINE Engine, System.IntPtr szManufacturer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRProductFamily(DTWAIN_OCRENGINE Engine, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szProductFamily, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRProductFamily(DTWAIN_OCRENGINE Engine, System.IntPtr szProductFamily, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRProductName(DTWAIN_OCRENGINE Engine, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szProductName, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRProductName(DTWAIN_OCRENGINE Engine, System.IntPtr szProductName, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_GetOCRText(DTWAIN_OCRENGINE Engine, int nPageNo, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Data, int dSize, ref int pActualSize, int nFlags);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_GetOCRText(DTWAIN_OCRENGINE Engine, int nPageNo, System.IntPtr Data, int dSize, ref int pActualSize, int nFlags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRTextInfoFloat(DTWAIN_OCRTEXTINFOHANDLE OCRTextInfo, int nCharPos, int nWhichItem, ref DTWAIN_FLOAT pInfo);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRTextInfoFloatEx(DTWAIN_OCRTEXTINFOHANDLE OCRTextInfo, int nWhichItem, ref DTWAIN_FLOAT pInfo, int bufSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_OCRTEXTINFOHANDLE DTWAIN_GetOCRTextInfoHandle(DTWAIN_OCRENGINE Engine, int nPageNo);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRTextInfoLong(DTWAIN_OCRTEXTINFOHANDLE OCRTextInfo, int nCharPos, int nWhichItem, ref int pInfo);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRTextInfoLongEx(DTWAIN_OCRTEXTINFOHANDLE OCRTextInfo, int nWhichItem, ref int pInfo, int bufSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRVersionInfo(DTWAIN_OCRENGINE Engine, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder buffer, int maxBufSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOCRVersionInfo(DTWAIN_OCRENGINE Engine, System.IntPtr buffer, int maxBufSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOrientation(DTWAIN_SOURCE Source, ref int lpOrient, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOrientationEx(DTWAIN_SOURCE Source, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetOverscan(DTWAIN_SOURCE Source, ref int lpOverscan, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPDFTextElementFloat(DTWAIN_PDFTEXTELEMENT TextElement, ref DTWAIN_FLOAT val1, ref DTWAIN_FLOAT val2, int Flags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPDFTextElementLong(DTWAIN_PDFTEXTELEMENT TextElement, ref int val1, ref int val2, int Flags);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPDFTextElementString(DTWAIN_PDFTEXTELEMENT TextElement, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szData, int maxLen, int Flags);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPDFTextElementString(DTWAIN_PDFTEXTELEMENT TextElement, System.IntPtr szData, int maxLen, int Flags);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPDFType1FontName(int FontVal, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szFont, int nChars);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPDFType1FontName(int FontVal, System.IntPtr szFont, int nChars);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPaperSize(DTWAIN_SOURCE Source, ref int lpPaperSize, int bCurrent);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPaperSizeName(int paperNumber, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder outName, int nSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPaperSizeName(int paperNumber, System.IntPtr outName, int nSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPatchcodeMaxPriorities(DTWAIN_SOURCE Source, ref int pMaxPriorities, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPatchcodeMaxRetries(DTWAIN_SOURCE Source, ref int pMaxRetries, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPatchcodePriorities(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY SearchPriorities);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPatchcodeSearchMode(DTWAIN_SOURCE Source, ref int pSearchMode, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPatchcodeTimeOut(DTWAIN_SOURCE Source, ref int pTimeOut, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPixelFlavor(DTWAIN_SOURCE Source, ref int lpPixelFlavor);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPixelType(DTWAIN_SOURCE Source, ref int PixelType, ref int BitDepth, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPrinter(DTWAIN_SOURCE Source, ref int lpPrinter, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPrinterEx(DTWAIN_SOURCE Source, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPrinterStartNumber(DTWAIN_SOURCE Source, ref int nStart);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPrinterStartNumberEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPrinterStringMode(DTWAIN_SOURCE Source, ref int PrinterMode, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPrinterStringModeEx(DTWAIN_SOURCE Source, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPrinterStrings(DTWAIN_SOURCE Source, ref DTWAIN_ARRAY ArrayString);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_GetPrinterStringsEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPrinterSuffixString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Suffix, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetPrinterSuffixString(DTWAIN_SOURCE Source, System.IntPtr Suffix, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetRegisteredMsg();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetResolution(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Resolution);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_FLOAT DTWAIN_GetResolutionEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetResolutionString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Resolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetResolutionString(DTWAIN_SOURCE Source, System.IntPtr Resolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetResourceString(int ResourceID, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetResourceString(int ResourceID, System.IntPtr lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetRotation(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Rotation);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_FLOAT DTWAIN_GetRotationEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetRotationString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Rotation);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetRotationString(DTWAIN_SOURCE Source, System.IntPtr Rotation);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSaveFileName(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder fName, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSaveFileName(DTWAIN_SOURCE Source, System.IntPtr fName, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSessionDetails([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szBuf, int nSize, int indentFactor, int bRefresh);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSessionDetails(System.IntPtr szBuf, int nSize, int indentFactor, int bRefresh);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetShadow(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Shadow);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetShadowString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Shadow);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetShadowString(DTWAIN_SOURCE Source, System.IntPtr Shadow);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetShortVersionString([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszVer, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetShortVersionString(System.IntPtr lpszVer, int nLength);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_GetSourceAcquisitions(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceDetails([MarshalAs(UnmanagedType.LPTStr)] string szSources, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szBuf, int nSize, int indentFactor, int bRefresh);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceDetails([MarshalAs(UnmanagedType.LPTStr)] string szSources, System.IntPtr szBuf, int nSize, int indentFactor, int bRefresh);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_IDENTITY DTWAIN_GetSourceID(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern TW_IDENTITY DTWAIN_GetSourceIDEx(DTWAIN_SOURCE Source, [In, Out] TW_IDENTITY pIdentity);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceManufacturer(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szProduct, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceManufacturer(DTWAIN_SOURCE Source, System.IntPtr szProduct, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceProductFamily(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szProduct, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceProductFamily(DTWAIN_SOURCE Source, System.IntPtr szProduct, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceProductName(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szProduct, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceProductName(DTWAIN_SOURCE Source, System.IntPtr szProduct, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceUnit(DTWAIN_SOURCE Source, ref int lpUnit);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceUnitEx(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceVersionInfo(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szProduct, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceVersionInfo(DTWAIN_SOURCE Source, System.IntPtr szProduct, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetSourceVersionNumber(DTWAIN_SOURCE Source, ref int pMajor, ref int pMinor);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetStaticLibVersion();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTempFileDirectory([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szFilePath, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTempFileDirectory(System.IntPtr szFilePath, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetThreshold(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Threshold);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetThresholdString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Threshold);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetThresholdString(DTWAIN_SOURCE Source, System.IntPtr Threshold);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTimeDate(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder szTimeDate);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTimeDate(DTWAIN_SOURCE Source, System.IntPtr szTimeDate);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_IDENTITY DTWAIN_GetTwainAppID();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern TW_IDENTITY DTWAIN_GetTwainAppIDEx([In, Out] TW_IDENTITY pIdentity);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTwainAvailability();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTwainAvailabilityEx([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder directories, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTwainAvailabilityEx(System.IntPtr directories, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HWND DTWAIN_GetTwainHwnd();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTwainMode();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTwainNameFromConstant(int lConstantType, int lTwainConstant, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszOut, int nSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTwainNameFromConstant(int lConstantType, int lTwainConstant, System.IntPtr lpszOut, int nSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTwainNameFromConstantEx(int lConstantType, int lTwainConstant, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszOut, int nSize);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTwainNameFromConstantEx(int lConstantType, int lTwainConstant, System.IntPtr lpszOut, int nSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetTwainTimeout();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetVersion(ref int lpMajor, ref int lpMinor, ref int lpVersionType);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetVersionCopyright([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszApp, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetVersionCopyright(System.IntPtr lpszApp, int nLength);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetVersionEx(ref int lMajor, ref int lMinor, ref int lVersionType, ref int lPatchLevel);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetVersionInfo([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszVer, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetVersionInfo(System.IntPtr lpszVer, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetVersionString([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszVer, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetVersionString(System.IntPtr lpszVer, int nLength);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetWindowsVersionInfo([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetWindowsVersionInfo(System.IntPtr lpszBuffer, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetXResolution(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Resolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetXResolutionString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Resolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetXResolutionString(DTWAIN_SOURCE Source, System.IntPtr Resolution);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetYResolution(DTWAIN_SOURCE Source, ref DTWAIN_FLOAT Resolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetYResolutionString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder Resolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_GetYResolutionString(DTWAIN_SOURCE Source, System.IntPtr Resolution);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_InitExtImageInfo(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_InitImageFileAppend([MarshalAs(UnmanagedType.LPTStr)] string szFile, int fType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_InitOCRInterface();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAcquiring();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAudioXferSupported(DTWAIN_SOURCE Source, int supportVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoBorderDetectEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoBorderDetectSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoBrightEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoBrightSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoDeskewEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoDeskewSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoFeedEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoFeedSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoRotateEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoRotateSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutoScanEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutomaticSenseMediumEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsAutomaticSenseMediumSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsBarcodeCapsSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsBarcodeDetectionEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsBarcodeSupported(DTWAIN_SOURCE Source, int BarCode);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsBlankPageDetectionOn(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsBufferedTileModeOn(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsBufferedTileModeSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsCapSupported(DTWAIN_SOURCE Source, int lCapability);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsCompressionSupported(DTWAIN_SOURCE Source, int Compression);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsCustomDSDataSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsDIBBlank(HANDLE hDib, DTWAIN_FLOAT threshold);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsDIBBlankString(HANDLE hDib, [MarshalAs(UnmanagedType.LPTStr)] string threshold);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsDeviceEventSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsDeviceOnLine(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsDoubleFeedDetectLengthSupported(DTWAIN_SOURCE Source, DTWAIN_FLOAT value);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsDoubleFeedDetectSupported(DTWAIN_SOURCE Source, int SupportVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsDoublePageCountOnDuplex(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsDuplexEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsDuplexSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsExtImageInfoSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsFeederEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsFeederLoaded(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsFeederSensitive(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsFeederSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsFileSystemSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsFileXferSupported(DTWAIN_SOURCE Source, int lFileType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsGetMessageLoopDetectionOn();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsGetMessageLoopEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldALastPageSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldALevelSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldAPrintFormatSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldAValueSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldBLastPageSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldBLevelSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldBPrintFormatSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldBValueSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldCLastPageSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldCLevelSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldCPrintFormatSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldCValueSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldDLastPageSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldDLevelSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldDPrintFormatSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldDValueSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldELastPageSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldELevelSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldEPrintFormatSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIAFieldEValueSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsImageAddressingSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIndicatorEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsIndicatorSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsInitialized();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsJobControlSupported(DTWAIN_SOURCE Source, int JobControl);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsLampEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsLampSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsLightPathSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsLightSourceSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsMaxBuffersSupported(DTWAIN_SOURCE Source, int MaxBuf);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsMemFileXferSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsMsgNotifyEnabled();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsNotifyTripletsEnabled();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsOCREngineActivated(DTWAIN_OCRENGINE OCREngine);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsOpenSourcesOnSelect();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsOrientationSupported(DTWAIN_SOURCE Source, int Orientation);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsOverscanSupported(DTWAIN_SOURCE Source, int SupportValue);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsPaperDetectable(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsPaperSizeSupported(DTWAIN_SOURCE Source, int PaperSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsPatchcodeCapsSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsPatchcodeDetectionEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsPatchcodeSupported(DTWAIN_SOURCE Source, int PatchCode);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsPeekMessageLoopEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsPixelTypeSupported(DTWAIN_SOURCE Source, int PixelType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsPrinterEnabled(DTWAIN_SOURCE Source, int Printer);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsPrinterSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsRotationSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsSessionEnabled();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsSkipImageInfoError(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsSourceAcquiring(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsSourceAcquiringEx(DTWAIN_SOURCE Source, int bUIOnly);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsSourceInUIOnlyMode(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsSourceOpen(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsSourceSelected(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsSourceValid(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsThumbnailEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsThumbnailSupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsTwainAvailable();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsTwainAvailableEx([MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder directories, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsTwainAvailableEx(System.IntPtr directories, int nMaxLen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsTwainMsg(ref POINT pMsg);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsUIControllable(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsUIEnabled(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_IsUIOnlySupported(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_LoadCustomStringResources([MarshalAs(UnmanagedType.LPTStr)] string sLangDLL);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_LoadCustomStringResourcesEx([MarshalAs(UnmanagedType.LPTStr)] string sLangDLL, int bClear);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_LoadLanguageResource(int nLanguage);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_MEMORY_PTR DTWAIN_LockMemory(HANDLE h);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_MEMORY_PTR DTWAIN_LockMemoryEx(HANDLE h);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_LogMessage([MarshalAs(UnmanagedType.LPTStr)] string message);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_MakeRGB(int red, int green, int blue);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_OpenSource(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_OpenSourcesOnSelect(int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_RANGE DTWAIN_RangeCreate(int nEnumType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_RANGE DTWAIN_RangeCreateFromCap(DTWAIN_SOURCE Source, int lCapType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeDestroy(DTWAIN_RANGE pSource);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeExpand(DTWAIN_RANGE pSource, ref DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_RangeExpandEx(DTWAIN_RANGE Range);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetAll(DTWAIN_RANGE pArray, System.IntPtr pVariantLow, System.IntPtr pVariantUp, System.IntPtr pVariantStep, System.IntPtr pVariantDefault, System.IntPtr pVariantCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetAllFloat(DTWAIN_RANGE pArray, ref DTWAIN_FLOAT pVariantLow, ref DTWAIN_FLOAT pVariantUp, ref DTWAIN_FLOAT pVariantStep, ref DTWAIN_FLOAT pVariantDefault, ref DTWAIN_FLOAT pVariantCurrent);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetAllFloatString(DTWAIN_RANGE pArray, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder dLow, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder dUp, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder dStep, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder dDefault, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder dCurrent);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetAllFloatString(DTWAIN_RANGE pArray, System.IntPtr dLow, System.IntPtr dUp, System.IntPtr dStep, System.IntPtr dDefault, System.IntPtr dCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetAllLong(DTWAIN_RANGE pArray, ref int pVariantLow, ref int pVariantUp, ref int pVariantStep, ref int pVariantDefault, ref int pVariantCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetCount(DTWAIN_RANGE pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetExpValue(DTWAIN_RANGE pArray, int lPos, System.IntPtr pVariant);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetExpValueFloat(DTWAIN_RANGE pArray, int lPos, ref DTWAIN_FLOAT pVal);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetExpValueFloatString(DTWAIN_RANGE pArray, int lPos, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder pVal);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetExpValueFloatString(DTWAIN_RANGE pArray, int lPos, System.IntPtr pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetExpValueLong(DTWAIN_RANGE pArray, int lPos, ref int pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetNearestValue(DTWAIN_RANGE pArray, System.IntPtr pVariantIn, System.IntPtr pVariantOut, int RoundType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetNearestValueFloat(DTWAIN_RANGE pArray, DTWAIN_FLOAT dIn, ref DTWAIN_FLOAT pOut, int RoundType);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetNearestValueFloatString(DTWAIN_RANGE pArray, [MarshalAs(UnmanagedType.LPTStr)] string dIn, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder pOut, int RoundType);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetNearestValueFloatString(DTWAIN_RANGE pArray, [MarshalAs(UnmanagedType.LPTStr)] string dIn, System.IntPtr pOut, int RoundType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetNearestValueLong(DTWAIN_RANGE pArray, int lIn, ref int pOut, int RoundType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetPos(DTWAIN_RANGE pArray, System.IntPtr pVariant, ref int pPos);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetPosFloat(DTWAIN_RANGE pArray, DTWAIN_FLOAT Val, ref int pPos);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetPosFloatString(DTWAIN_RANGE pArray, [MarshalAs(UnmanagedType.LPTStr)] string Val, ref int pPos);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetPosLong(DTWAIN_RANGE pArray, int Value, ref int pPos);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetValue(DTWAIN_RANGE pArray, int nWhich, System.IntPtr pVariant);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetValueFloat(DTWAIN_RANGE pArray, int nWhich, ref DTWAIN_FLOAT pVal);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetValueFloatString(DTWAIN_RANGE pArray, int nWhich, [MarshalAs(UnmanagedType.LPTStr)] System.Text.StringBuilder pVal);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetValueFloatString(DTWAIN_RANGE pArray, int nWhich, System.IntPtr pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeGetValueLong(DTWAIN_RANGE pArray, int nWhich, ref int pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeIsValid(DTWAIN_RANGE Range, ref int pStatus);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeSetAll(DTWAIN_RANGE pArray, System.IntPtr pVariantLow, System.IntPtr pVariantUp, System.IntPtr pVariantStep, System.IntPtr pVariantDefault, System.IntPtr pVariantCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeSetAllFloat(DTWAIN_RANGE pArray, DTWAIN_FLOAT dLow, DTWAIN_FLOAT dUp, DTWAIN_FLOAT dStep, DTWAIN_FLOAT dDefault, DTWAIN_FLOAT dCurrent);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeSetAllFloatString(DTWAIN_RANGE pArray, [MarshalAs(UnmanagedType.LPTStr)] string dLow, [MarshalAs(UnmanagedType.LPTStr)] string dUp, [MarshalAs(UnmanagedType.LPTStr)] string dStep, [MarshalAs(UnmanagedType.LPTStr)] string dDefault, [MarshalAs(UnmanagedType.LPTStr)] string dCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeSetAllLong(DTWAIN_RANGE pArray, int lLow, int lUp, int lStep, int lDefault, int lCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeSetValue(DTWAIN_RANGE pArray, int nWhich, System.IntPtr pVal);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeSetValueFloat(DTWAIN_RANGE pArray, int nWhich, DTWAIN_FLOAT Val);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeSetValueFloatString(DTWAIN_RANGE pArray, int nWhich, [MarshalAs(UnmanagedType.LPTStr)] string Val);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RangeSetValueLong(DTWAIN_RANGE pArray, int nWhich, int Val);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RemovePDFTextElement(DTWAIN_SOURCE Source, DTWAIN_PDFTEXTELEMENT TextElement);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ResetPDFTextElement(DTWAIN_PDFTEXTELEMENT TextElement);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_RewindPage(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_RotateImage(HANDLE hDib, DTWAIN_FLOAT rotationAngle);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern HANDLE DTWAIN_RotateImageString(HANDLE hDib, [MarshalAs(UnmanagedType.LPTStr)] string rotationAngle);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_OCRENGINE DTWAIN_SelectDefaultOCREngine();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_SOURCE DTWAIN_SelectDefaultSource();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_SOURCE DTWAIN_SelectDefaultSourceWithOpen(int bOpen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_OCRENGINE DTWAIN_SelectOCREngine();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_OCRENGINE DTWAIN_SelectOCREngine2(HWND hWndParent, [MarshalAs(UnmanagedType.LPTStr)] string szTitle, int xPos, int yPos, int nOptions);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_OCRENGINE DTWAIN_SelectOCREngine2Ex(HWND hWndParent, [MarshalAs(UnmanagedType.LPTStr)] string szTitle, int xPos, int yPos, [MarshalAs(UnmanagedType.LPTStr)] string szIncludeFilter, [MarshalAs(UnmanagedType.LPTStr)] string szExcludeFilter, [MarshalAs(UnmanagedType.LPTStr)] string szNameMapping, int nOptions);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_OCRENGINE DTWAIN_SelectOCREngineByName([MarshalAs(UnmanagedType.LPTStr)] string lpszName);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_SOURCE DTWAIN_SelectSource();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_SOURCE DTWAIN_SelectSource2(HWND hWndParent, [MarshalAs(UnmanagedType.LPTStr)] string szTitle, int xPos, int yPos, int nOptions);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_SOURCE DTWAIN_SelectSource2Ex(HWND hWndParent, [MarshalAs(UnmanagedType.LPTStr)] string szTitle, int xPos, int yPos, [MarshalAs(UnmanagedType.LPTStr)] string szIncludeFilter, [MarshalAs(UnmanagedType.LPTStr)] string szExcludeFilter, [MarshalAs(UnmanagedType.LPTStr)] string szNameMapping, int nOptions);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_SOURCE DTWAIN_SelectSourceByName([MarshalAs(UnmanagedType.LPTStr)] string lpszName);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_SOURCE DTWAIN_SelectSourceByNameWithOpen([MarshalAs(UnmanagedType.LPTStr)] string lpszName, int bOpen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_SOURCE DTWAIN_SelectSourceWithOpen(int bOpen);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAcquireArea(DTWAIN_SOURCE Source, int lSetType, DTWAIN_ARRAY FloatEnum, DTWAIN_ARRAY ActualEnum);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAcquireArea2(DTWAIN_SOURCE Source, DTWAIN_FLOAT left, DTWAIN_FLOAT top, DTWAIN_FLOAT right, DTWAIN_FLOAT bottom, int lUnit, int Flags);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAcquireArea2String(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string left, [MarshalAs(UnmanagedType.LPTStr)] string top, [MarshalAs(UnmanagedType.LPTStr)] string right, [MarshalAs(UnmanagedType.LPTStr)] string bottom, int lUnit, int Flags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAcquireImageNegative(DTWAIN_SOURCE Source, int IsNegative);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAcquireImageScale(DTWAIN_SOURCE Source, DTWAIN_FLOAT xscale, DTWAIN_FLOAT yscale);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAcquireImageScaleString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string xscale, [MarshalAs(UnmanagedType.LPTStr)] string yscale);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAcquireStripBuffer(DTWAIN_SOURCE Source, HANDLE hMem);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAcquireStripSize(DTWAIN_SOURCE Source, uint StripSize);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAlarmVolume(DTWAIN_SOURCE Source, int Volume);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAlarms(DTWAIN_SOURCE Source, DTWAIN_ARRAY Alarms);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAllCapsToDefault(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAppInfo([MarshalAs(UnmanagedType.LPTStr)] string szVerStr, [MarshalAs(UnmanagedType.LPTStr)] string szManu, [MarshalAs(UnmanagedType.LPTStr)] string szProdFam, [MarshalAs(UnmanagedType.LPTStr)] string szProdName);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAuthor(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string szAuthor);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAvailablePrinters(DTWAIN_SOURCE Source, int lpAvailPrinters);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetAvailablePrintersArray(DTWAIN_SOURCE Source, DTWAIN_ARRAY AvailPrinters);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBarcodeMaxPriorities(DTWAIN_SOURCE Source, int nMaxSearchRetries);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBarcodeMaxRetries(DTWAIN_SOURCE Source, int nMaxRetries);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBarcodePriorities(DTWAIN_SOURCE Source, DTWAIN_ARRAY SearchPriorities);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBarcodeSearchMode(DTWAIN_SOURCE Source, int nSearchMode);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBarcodeTimeOut(DTWAIN_SOURCE Source, int TimeOutValue);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBitDepth(DTWAIN_SOURCE Source, int BitDepth, int bSetCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBlankPageDetection(DTWAIN_SOURCE Source, DTWAIN_FLOAT threshold, int discard_option, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBlankPageDetectionEx(DTWAIN_SOURCE Source, DTWAIN_FLOAT threshold, int autodetect, int detectOpts, int bSet);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBlankPageDetectionExString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string threshold, int autodetect_option, int detectOpts, int bSet);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBlankPageDetectionString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string threshold, int autodetect_option, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBrightness(DTWAIN_SOURCE Source, DTWAIN_FLOAT Brightness);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBrightnessString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Brightness);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetBufferedTileMode(DTWAIN_SOURCE Source, int bTileMode);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTwainCallback DTWAIN_SetCallback(DTwainCallback Fn, int UserData);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTwainCallback64 DTWAIN_SetCallback64(DTwainCallback64 Fn, long UserData);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetCamera(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string szCamera);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetCapValues(DTWAIN_SOURCE Source, int lCap, int lSetType, DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetCapValuesEx(DTWAIN_SOURCE Source, int lCap, int lSetType, int lContainerType, DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetCapValuesEx2(DTWAIN_SOURCE Source, int lCap, int lSetType, int lContainerType, int nDataType, DTWAIN_ARRAY pArray);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetCaption(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Caption);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetCompressionType(DTWAIN_SOURCE Source, int lCompression, int bSetCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetContrast(DTWAIN_SOURCE Source, DTWAIN_FLOAT Contrast);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetContrastString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Contrast);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetCountry(int nCountry);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetCurrentRetryCount(DTWAIN_SOURCE Source, int nCount);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetCustomDSData(DTWAIN_SOURCE Source, HANDLE hData, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U8, SizeParamIndex = 3)] byte[] Data, uint dSize, int nFlags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetDSMSearchOrder(int SearchPath);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetDSMSearchOrderEx([MarshalAs(UnmanagedType.LPTStr)] string SearchOrder, [MarshalAs(UnmanagedType.LPTStr)] string UserPath);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetDefaultSource(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetDeviceNotifications(DTWAIN_SOURCE Source, int DevEvents);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetDeviceTimeDate(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string szTimeDate);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetDoubleFeedDetectLength(DTWAIN_SOURCE Source, DTWAIN_FLOAT Value);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetDoubleFeedDetectLengthString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string value);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetDoubleFeedDetectValues(DTWAIN_SOURCE Source, DTWAIN_ARRAY prray);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetDoublePageCountOnDuplex(DTWAIN_SOURCE Source, int bDoubleCount);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetEOJDetectValue(DTWAIN_SOURCE Source, int nValue);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetErrorBufferThreshold(int nErrors);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetErrorCallback(DTwainErrorProc proc, int UserData);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetErrorCallback64(DTwainErrorProc64 proc, long UserData64);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetFeederAlignment(DTWAIN_SOURCE Source, int lpAlignment);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetFeederOrder(DTWAIN_SOURCE Source, int lOrder);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetFeederWaitTime(DTWAIN_SOURCE Source, int waitTime, int flags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetFileAutoIncrement(DTWAIN_SOURCE Source, int Increment, int bResetOnAcquire, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetFileCompressionType(DTWAIN_SOURCE Source, int lCompression, int bIsCustom);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetFileSavePos(HWND hWndParent, [MarshalAs(UnmanagedType.LPTStr)] string szTitle, int xPos, int yPos, int nFlags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetFileXferFormat(DTWAIN_SOURCE Source, int lFileType, int bSetCurrent);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetHalftone(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string lpHalftone);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetHighlight(DTWAIN_SOURCE Source, DTWAIN_FLOAT Highlight);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetHighlightString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Highlight);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetJobControl(DTWAIN_SOURCE Source, int JobControl, int bSetCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetJpegValues(DTWAIN_SOURCE Source, int Quality, int Progressive);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetJpegXRValues(DTWAIN_SOURCE Source, int Quality, int Progressive);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetLanguage(int nLanguage);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetLastError(int nError);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetLightPath(DTWAIN_SOURCE Source, int LightPath);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetLightPathEx(DTWAIN_SOURCE Source, DTWAIN_ARRAY LightPaths);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetLightSource(DTWAIN_SOURCE Source, int LightSource);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetLightSources(DTWAIN_SOURCE Source, DTWAIN_ARRAY LightSources);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetLogSaveThreshold(LONG64 lineCount);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetLoggerCallback(DTwainLoggerProc logProc, long UserData);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetManualDuplexMode(DTWAIN_SOURCE Source, int Flags, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetMaxAcquisitions(DTWAIN_SOURCE Source, int MaxAcquires);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetMaxBuffers(DTWAIN_SOURCE Source, int MaxBuf);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetMaxRetryAttempts(DTWAIN_SOURCE Source, int nAttempts);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetMultipageScanMode(DTWAIN_SOURCE Source, int ScanType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetNoiseFilter(DTWAIN_SOURCE Source, int NoiseFilter);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetOCRCapValues(DTWAIN_OCRENGINE Engine, int OCRCapValue, int SetType, DTWAIN_ARRAY CapValues);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetOrientation(DTWAIN_SOURCE Source, int Orient, int bSetCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetOverscan(DTWAIN_SOURCE Source, int Value, int bSetCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFAESEncryption(DTWAIN_SOURCE Source, int nWhichEncryption, int bUseAES);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFASCIICompression(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFAuthor(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string lpAuthor);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFCompression(DTWAIN_SOURCE Source, int bCompression);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFCreator(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string lpCreator);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFEncryption(DTWAIN_SOURCE Source, int bUseEncryption, [MarshalAs(UnmanagedType.LPTStr)] string lpszUser, [MarshalAs(UnmanagedType.LPTStr)] string lpszOwner, uint Permissions, int UseStrongEncryption);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFJpegQuality(DTWAIN_SOURCE Source, int Quality);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFKeywords(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string lpKeyWords);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFOCRConversion(DTWAIN_OCRENGINE Engine, int PageType, int FileType, int PixelType, int BitDepth, int Options);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFOCRMode(DTWAIN_SOURCE Source, int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFOrientation(DTWAIN_SOURCE Source, int lPOrientation);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFPageScale(DTWAIN_SOURCE Source, int nOptions, DTWAIN_FLOAT xScale, DTWAIN_FLOAT yScale);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFPageScaleString(DTWAIN_SOURCE Source, int nOptions, [MarshalAs(UnmanagedType.LPTStr)] string xScale, [MarshalAs(UnmanagedType.LPTStr)] string yScale);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFPageSize(DTWAIN_SOURCE Source, int PageSize, DTWAIN_FLOAT CustomWidth, DTWAIN_FLOAT CustomHeight);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFPageSizeString(DTWAIN_SOURCE Source, int PageSize, [MarshalAs(UnmanagedType.LPTStr)] string CustomWidth, [MarshalAs(UnmanagedType.LPTStr)] string CustomHeight);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFPolarity(DTWAIN_SOURCE Source, int Polarity);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFProducer(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string lpProducer);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFSubject(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string lpSubject);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFTextElementFloat(DTWAIN_PDFTEXTELEMENT TextElement, DTWAIN_FLOAT val1, DTWAIN_FLOAT val2, int Flags);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFTextElementFloatString(DTWAIN_PDFTEXTELEMENT TextElement, [MarshalAs(UnmanagedType.LPTStr)] string val1, [MarshalAs(UnmanagedType.LPTStr)] string val2, int Flags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFTextElementLong(DTWAIN_PDFTEXTELEMENT TextElement, int val1, int val2, int Flags);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFTextElementString(DTWAIN_PDFTEXTELEMENT TextElement, [MarshalAs(UnmanagedType.LPTStr)] string val1, int Flags);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPDFTitle(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string lpTitle);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPaperSize(DTWAIN_SOURCE Source, int PaperSize, int bSetCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPatchcodeMaxPriorities(DTWAIN_SOURCE Source, int nMaxSearchRetries);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPatchcodeMaxRetries(DTWAIN_SOURCE Source, int nMaxRetries);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPatchcodePriorities(DTWAIN_SOURCE Source, DTWAIN_ARRAY SearchPriorities);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPatchcodeSearchMode(DTWAIN_SOURCE Source, int nSearchMode);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPatchcodeTimeOut(DTWAIN_SOURCE Source, int TimeOutValue);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPixelFlavor(DTWAIN_SOURCE Source, int PixelFlavor);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPixelType(DTWAIN_SOURCE Source, int PixelType, int BitDepth, int bSetCurrent);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPostScriptTitle(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string szTitle);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPostScriptType(DTWAIN_SOURCE Source, int PSType);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPrinter(DTWAIN_SOURCE Source, int Printer, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPrinterEx(DTWAIN_SOURCE Source, int Printer, int bCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPrinterStartNumber(DTWAIN_SOURCE Source, int nStart);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPrinterStringMode(DTWAIN_SOURCE Source, int PrinterMode, int bSetCurrent);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPrinterStrings(DTWAIN_SOURCE Source, DTWAIN_ARRAY ArrayString, ref int pNumStrings);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetPrinterSuffixString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Suffix);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetQueryCapSupport(int bSet);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetResolution(DTWAIN_SOURCE Source, DTWAIN_FLOAT Resolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetResolutionString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Resolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetResourcePath([MarshalAs(UnmanagedType.LPTStr)] string ResourcePath);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetRotation(DTWAIN_SOURCE Source, DTWAIN_FLOAT Rotation);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetRotationString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Rotation);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetSaveFileName(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string fName);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetShadow(DTWAIN_SOURCE Source, DTWAIN_FLOAT Shadow);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetShadowString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Shadow);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetSourceUnit(DTWAIN_SOURCE Source, int Unit);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetTIFFCompressType(DTWAIN_SOURCE Source, int Setting);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetTIFFInvert(DTWAIN_SOURCE Source, int Setting);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetTempFileDirectory([MarshalAs(UnmanagedType.LPTStr)] string szFilePath);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetTempFileDirectoryEx([MarshalAs(UnmanagedType.LPTStr)] string szFilePath, int CreationFlags);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetThreshold(DTWAIN_SOURCE Source, DTWAIN_FLOAT Threshold, int bSetBithDepthReduction);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetThresholdString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Threshold, int bSetBitDepthReduction);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetTwainDSM(int DSMType);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetTwainLog(uint LogFlags, [MarshalAs(UnmanagedType.LPTStr)] string lpszLogFile);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetTwainMode(int lAcquireMode);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetTwainTimeout(int milliseconds);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTwainDIBUpdateProc DTWAIN_SetUpdateDibProc(DTwainDIBUpdateProc DibProc);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetXResolution(DTWAIN_SOURCE Source, DTWAIN_FLOAT xResolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetXResolutionString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Resolution);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetYResolution(DTWAIN_SOURCE Source, DTWAIN_FLOAT yResolution);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SetYResolutionString(DTWAIN_SOURCE Source, [MarshalAs(UnmanagedType.LPTStr)] string Resolution);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ShowUIOnly(DTWAIN_SOURCE Source);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_ShutdownOCREngine(DTWAIN_OCRENGINE OCREngine);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SkipImageInfoError(DTWAIN_SOURCE Source, int bSkip);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_StartThread(DTWAIN_HANDLE DLLHandle);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_StartTwainSession(HWND hWndMsg, [MarshalAs(UnmanagedType.LPTStr)] string lpszDLLName);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_SysDestroy();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_HANDLE DTWAIN_SysInitialize();

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_HANDLE DTWAIN_SysInitializeEx([MarshalAs(UnmanagedType.LPTStr)] string szINIPath);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_HANDLE DTWAIN_SysInitializeEx2([MarshalAs(UnmanagedType.LPTStr)] string szINIPath, [MarshalAs(UnmanagedType.LPTStr)] string szImageDLLPath, [MarshalAs(UnmanagedType.LPTStr)] string szLangResourcePath);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_HANDLE DTWAIN_SysInitializeLib(HINSTANCE hInstance);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_HANDLE DTWAIN_SysInitializeLibEx(HINSTANCE hInstance, [MarshalAs(UnmanagedType.LPTStr)] string szINIPath);

        [DllImport(DTWAIN_LIBRARY, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_HANDLE DTWAIN_SysInitializeLibEx2(HINSTANCE hInstance, [MarshalAs(UnmanagedType.LPTStr)] string szINIPath, [MarshalAs(UnmanagedType.LPTStr)] string szImageDLLPath, [MarshalAs(UnmanagedType.LPTStr)] string szLangResourcePath);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_HANDLE DTWAIN_SysInitializeNoBlocking();

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern DTWAIN_ARRAY DTWAIN_TestGetCap(DTWAIN_SOURCE Source, int lCapability);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_UnlockMemory(HANDLE h);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_UnlockMemoryEx(HANDLE h);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_UpdateCurrentAcquiredImage(DTWAIN_SOURCE Source, HANDLE hNewDib);

        [DllImport(DTWAIN_LIBRARY,  ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern int DTWAIN_UseMultipleThreads(int bSet);

    }
}
