View on GitHub

SARAFF SOFTWARE

All products / Saraff.TwainX.Extensions

Migration

From 1.0.2.616 to 1.0.3.616

Dependency change

Saraff.TwainX.Extensions 1.0.2.616 referenced Saraff.TwainX.NET 1.0.27.614. Version 1.0.3.616 references Saraff.TwainX 1.0.35.

Both packages ship Saraff.TwainX.dll in the Saraff.TwainX namespace, so they must not be referenced together. Remove the old reference:

<!-- remove -->
<PackageReference Include="Saraff.TwainX.NET" Version="1.0.27.614" />

<!-- keep -->
<PackageReference Include="Saraff.TwainX.Extensions" Version="1.0.3.616" />

After restore, project.assets.json should contain Saraff.TwainX/1.0.35, not Saraff.TwainX.NET/1.0.27.614.

New asynchronous API

Version 1.0.3.616 adds:

The async path creates a TwainXAcquisitionSession with its own TwainX and dedicated thread. It uses native transfer and copies each transferred stream into a result-owned MemoryStream. See Asynchronous acquisition.

Capability conversion

The following behavior is fixed:

Choose T that matches the TWAIN capability type. See Capabilities.

Lifecycle and concurrency

Package metadata

Upgrade

dotnet add package Saraff.TwainX.Extensions --version 1.0.3.616

or:

<PackageReference Include="Saraff.TwainX.Extensions" Version="1.0.3.616" />

From Saraff.Twain.Extensions

Saraff.Twain.Extensions is the extensions package for the Windows Saraff.Twain product (Twain32, System.Drawing images, TWAIN 1.x and 2.x). Saraff.TwainX.Extensions targets Saraff.TwainX (TwainX, streams, TWAIN 2.x/DS2).

The two packages are not drop-in replacements:

  Saraff.Twain.Extensions Saraff.TwainX.Extensions
Core type Twain32 TwainX
Image model System.Drawing.Image Stream
Target net462, net8.0-windows netstandard2.0
TWAIN 1.x and 2.x 2.x / DS2
Source open XDs.Open() / XDs.Close() lazy XDs.TwainX
Async no XDs.AcquireAsync

Port the code by replacing the package and adapting the core type, image handling and source lifecycle. Capability names (TwCap, TwQC, TwSX, TwPixelType) are similar because both packages wrap TWAIN, but the event argument and image types differ.

Version policy

The package follows the core Saraff.TwainX version for compatibility decisions. The extensions package version is independent but is validated against the core package at build and publish time.