VintaSoft Twain .NET SDK v10.2
How to create predefined session setup for high-volume scanner?

SDK allows to load/save predefined session setups for mid- and high-volume scanners.


Example: Here is an example that shows how to save the current device settings to xml file.

''' <summary>
''' Saves the device settings.
''' </summary>
Public Sub SaveDeviceSettings(ByVal device As Vintasoft.Twain.Device)
    ' open the device
    device.Open()

    Using fs As New System.IO.FileStream("scanner-setup.xml", System.IO.FileMode.Append, System.IO.FileAccess.Write)
        device.SaveSettings(fs)
    End Using
End Sub
              
/// <summary>
/// Saves the device settings.
/// </summary>
public void SaveDeviceSettings(Vintasoft.Twain.Device device)
{
    // open the device
    device.Open();

    using (System.IO.FileStream fs = new System.IO.FileStream("scanner-setup.xml", System.IO.FileMode.Append, System.IO.FileAccess.Write))
    {
        device.SaveSettings(fs);
    }
}
                


Example: This example shows how to load previously saved device settings into the device.
''' <summary>
''' Loads the device settings.
''' </summary>
Public Sub LoadDeviceSettings(ByVal device As Vintasoft.Twain.Device)
    ' open the device
    device.Open()

    Using fs As New System.IO.FileStream("scanner-setup.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read)
        device.LoadSettings(fs)
    End Using
End Sub
              
/// <summary>
/// Loads the device settings.
/// </summary>
public void LoadDeviceSettings(Vintasoft.Twain.Device device)
{
    // open the device
    device.Open();

    using (System.IO.FileStream fs = new System.IO.FileStream("scanner-setup.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read))
    {
        device.LoadSettings(fs);
    }
}