VintaSoft Twain .NET SDK v10.2
Vintasoft.Twain Namespace / DocumentFeeder Class
Members Example




In This Topic
    DocumentFeeder Class
    In This Topic
    Class that allows to manipulate the automatic document feeder of TWAIN device.
    Object Model
    DocumentFeeder Class
    Syntax
    'Declaration
     
    Public NotInheritable Class DocumentFeeder 
    'Usage
     
    Dim instance As DocumentFeeder
    public sealed class DocumentFeeder 
    public __gc __sealed class DocumentFeeder 
    public ref class DocumentFeeder sealed 
    Example
    This example shows how to use document feeder of the device.
    Private Sub AcquireImagesFromAdf(ByVal device As Device)
        ' specify that device UI must not be used
        device.ShowUI = False
        ' specify that device must be closed after scan
        device.DisableAfterAcquire = True
                
        ' open the device
        device.Open()
        ' set device settings
        device.PixelType = PixelType.RGB
        device.UnitOfMeasure = UnitOfMeasure.Inches
        device.Resolution = New Resolution(200.0F, 200.0F)
                
        ' set document feeder settings
        If device.HasFeeder Then
            device.DocumentFeeder.Enabled = True
            device.XferCount = -1
                
            ' enable duplex if possible
            If device.DocumentFeeder.DuplexMode <> DuplexMode.None Then
                device.DocumentFeeder.DuplexEnabled = True
            End If
                
            ' acquire images from device
            If device.DocumentFeeder.PaperDetectable Then
                If device.DocumentFeeder.Loaded Then
                    device.Acquire()
                End If
            Else
                device.Acquire()
            End If
        End If
    End Sub
    private void AcquireImagesFromAdf(Device device)
    {
        // specify that device UI must not be used
        device.ShowUI = false;
        // specify that device must be closed after scan
        device.DisableAfterAcquire = true;
        
        // open the device
        device.Open();
        // set device settings
        device.PixelType = PixelType.RGB;
        device.UnitOfMeasure = UnitOfMeasure.Inches;
        device.Resolution = new Resolution(200f, 200f);
                
        // set document feeder settings
        if (device.HasFeeder)
        {
            device.DocumentFeeder.Enabled = true;
            device.XferCount = -1;
                
            // enable duplex if possible
            if (device.DocumentFeeder.DuplexMode != DuplexMode.None)
                device.DocumentFeeder.DuplexEnabled = true;
                
            // acquire images from device
            if (device.DocumentFeeder.PaperDetectable)
            {
                if (device.DocumentFeeder.Loaded)
                    device.Acquire();
            }
            else
                device.Acquire();
        }
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Twain.DocumentFeeder

    Requirements

    Target Platforms: Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also