RazorWebTWAIN 0.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package RazorWebTWAIN --version 0.1.0
NuGet\Install-Package RazorWebTWAIN -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RazorWebTWAIN" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RazorWebTWAIN --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RazorWebTWAIN, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RazorWebTWAIN as a Cake Addin
#addin nuget:?package=RazorWebTWAIN&version=0.1.0
// Install RazorWebTWAIN as a Cake Tool
#tool nuget:?package=RazorWebTWAIN&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Razor Web TWAIN
A Razor class library for Dynamic Web TWAIN. It allows you to add scanning functionality to your Blazor application.
Dynamic Web TWAIN Version
v18.1
Prerequisites
- Visual Studio 2022
- Dynamic Web TWAIN license key
Quick Start
Add the following code to your razor page:
@page "/"
@inject IJSRuntime JSRuntime
@using System.Text.Json;
<h1> Dynamic Web TWAIN Sample</h1>
<select id="sources"></select>
<br />
<button @onclick="AcquireImage">Scan Documents</button>
<button @onclick="LoadDocument">Load Documents</button>
<button @onclick="RemoveSelected">Remove Selected</button>
<button @onclick="RemoveAll">Remove All</button>
<button @onclick="Save">Download Documents</button>
<div id="document-container"></div>
@code {
JsInterop jsInterop;
protected override void OnInitialized()
{
jsInterop = new JsInterop(JSRuntime);
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await jsInterop.LoadDWT("LICENSE-KEY");
await jsInterop.InitContainer("document-container", 640, 640);
await jsInterop.GetDevices("sources");
}
}
public async Task AcquireImage()
{
// https://www.dynamsoft.com/web-twain/docs/info/api/WebTwain_Acquire.html#acquireimageasync
var deviceConfiguration = new {
IfShowUI = false,
PixelType = PixelType.TWPT_RGB,
Resolution = 300,
IfFeederEnabled = true,
IfDuplexEnabled = false,
IfDisableSourceAfterAcquire = true,
IfGetImageInfo = true,
IfGetExtImageInfo = true,
extendedImageInfoQueryLevel = 0
};
// serialize the object to a JSON string
var jsonString = JsonSerializer.Serialize(deviceConfiguration);
await jsInterop.AcquireImage(jsonString);
}
public async Task LoadDocument()
{
await jsInterop.LoadDocument();
}
public async Task RemoveSelected()
{
await jsInterop.RemoveSelected();
}
public async Task RemoveAll()
{
await jsInterop.RemoveAll();
}
public async Task Save()
{
await jsInterop.Save(ImageType.PDF, "test");
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.AspNetCore.Components.Web (>= 6.0.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Added basic document scanning and uploading methods.