RapidScanner 1.0.9
dotnet add package RapidScanner --version 1.0.9
NuGet\Install-Package RapidScanner -Version 1.0.9
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="RapidScanner" Version="1.0.9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RapidScanner --version 1.0.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RapidScanner, 1.0.9"
#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 RapidScanner as a Cake Addin #addin nuget:?package=RapidScanner&version=1.0.9 // Install RapidScanner as a Cake Tool #tool nuget:?package=RapidScanner&version=1.0.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RapidScanner .NET SDK
A modern, high-performance document scanning solution for .NET applications with AI-powered document processing capabilities.
Features
Core Scanning Features
- High-performance scanning with memory pooling
- Async/await support throughout
- Multiple color modes (Color, Grayscale, BlackAndWhite)
- Various paper sizes support
- Multiple page scanning
- Preview support
- Real-time progress tracking
Image Processing
- Memory-efficient image processing using Span<T>
- Auto-enhancement and color correction
- Document bounds detection
- Deskew and rotation correction
- Shadow removal
- Noise reduction
- Barcode and QR code detection
- Multiple output formats (PDF, JPEG, PNG, TIFF)
Document AI Capabilities
- Text extraction (OCR)
- Document classification
- Table detection and extraction
- Form field recognition
- Signature detection
- Layout analysis
Installation
Install via NuGet Package Manager:
dotnet add package RapidScanner
Quick Start
Basic Scanning
// Create and configure scanner using fluent API
var scanner = await Scanner.Create()
.WithResolution(300)
.WithColorMode(ColorMode.Color)
.WithSize("A4")
.WithOutputFormat(ImageFormat.Pdf)
.BuildAsync();
// Register for progress updates
scanner.ScanProgress += (sender, e) =>
{
Console.WriteLine($"Scan progress: {e.Progress}%");
};
// Start scanning
var result = await scanner.ScanAsync("output.pdf");
Image Processing
// Create image processor with custom buffer size
using var processor = new ImageProcessor(maxArrayLength: 2 * 1024 * 1024); // 2MB buffer
// Configure processing options
var options = new ImageProcessingOptions
{
EnableNoiseReduction = true,
EnableColorCorrection = true,
EnableSharpening = true,
Quality = 95
};
// Process image with efficient memory usage
using var fileStream = File.OpenRead("input.jpg");
byte[] processedImage = await processor.ProcessImageAsync(fileStream, options);
await File.WriteAllBytesAsync("output.jpg", processedImage);
Document AI Features
using var docAi = new DocumentAI();
// Extract text with OCR
var text = await docAi.ExtractTextAsync("document.pdf",
languages: new[] { "en", "fr" });
// Analyze document layout
var layout = await docAi.AnalyzeLayoutAsync("document.pdf");
// Extract tables
var tables = await docAi.ExtractTablesAsync("document.pdf");
// Detect signatures
var signatures = await docAi.DetectSignaturesAsync("document.pdf");
Advanced Features
Custom Workflow
// Define a custom scanning workflow
var workflow = new ScanWorkflow()
.AddStep(new ScanStep())
.AddStep(new ImageProcessingStep
{
NoiseReduction = true,
ColorCorrection = true
})
.AddStep(new OcrStep
{
Languages = new[] { "en" }
})
.AddStep(new SaveStep
{
Format = ImageFormat.Pdf,
Path = "processed_document.pdf"
});
// Execute workflow
await workflow.ExecuteAsync();
Memory-Efficient Processing
// Use ArrayPool for efficient memory usage
using var processor = new ImageProcessor();
await using var stream = File.OpenRead("large_image.jpg");
// Process image in chunks with minimal allocations
await foreach (var chunk in processor.ProcessStreamAsync(stream))
{
// Handle each processed chunk
await outputStream.WriteAsync(chunk);
}
Performance Considerations
- Use the fluent API for better code readability and compile-time validation
- Leverage
ArrayPool<T>
for large image processing operations - Use cancellation tokens for long-running operations
- Implement proper disposal of resources using
IAsyncDisposable
- Consider using memory-mapped files for very large documents
Error Handling
The SDK uses specific exception types for better error handling:
ScannerException
: For scanner-related errorsImageProcessorException
: For image processing errorsDocumentAIException
: For AI-related errors
Example:
try
{
await scanner.ScanAsync(settings);
}
catch (ScannerException ex) when (ex.Message.Contains("No devices found"))
{
Console.WriteLine("Please connect a scanner and try again.");
}
catch (ScannerException ex)
{
Console.WriteLine($"Scanning failed: {ex.Message}");
}
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Created by MohaNed Ghawar
Support
For support, please:
- Check the Documentation
- Open an issue on the GitHub repository
- Contact support@rapidscanner.dev
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 is compatible. 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 is compatible. 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.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- System.IO.Pipelines (>= 8.0.0)
- System.IO.Ports (>= 6.0.0)
- System.Memory (>= 4.5.5)
- System.Text.Json (>= 8.0.5)
-
net7.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- System.IO.Pipelines (>= 8.0.0)
- System.IO.Ports (>= 7.0.0)
- System.Memory (>= 4.5.5)
- System.Text.Json (>= 8.0.5)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- System.IO.Pipelines (>= 8.0.0)
- System.IO.Ports (>= 8.0.0)
- System.Memory (>= 4.5.5)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.