RazorDocumentLibrary 1.0.1
Please use the built-in Dynamsoft JavaScript SDK directly within your Blazor project to access the full range of functionalities.
dotnet add package RazorDocumentLibrary --version 1.0.1
NuGet\Install-Package RazorDocumentLibrary -Version 1.0.1
<PackageReference Include="RazorDocumentLibrary" Version="1.0.1" />
paket add RazorDocumentLibrary --version 1.0.1
#r "nuget: RazorDocumentLibrary, 1.0.1"
// Install RazorDocumentLibrary as a Cake Addin #addin nuget:?package=RazorDocumentLibrary&version=1.0.1 // Install RazorDocumentLibrary as a Cake Tool #tool nuget:?package=RazorDocumentLibrary&version=1.0.1
Razor Document Library
A Razor Class Library built using the Dynamsoft Document Normalizer SDK, which provides APIs for document edge detection and document rectification.
Demo Video
Online Demo
https://yushulx.me/Razor-Document-Library/
Prerequisites
Quick Usage
Import and initialize the Razor Document Library.
@using RazorDocumentLibrary @code { private DocumentJsInterop? documentJsInterop; protected override async Task OnInitializedAsync() { documentJsInterop = new DocumentJsInterop(JSRuntime); await documentJsInterop.LoadJS(); } }
Set the license key and load the wasm module.
await documentJsInterop.SetLicense(licenseKey); await documentJsInterop.LoadWasm();
Createa a document normalizer instance.
DocumentNormalizer normalizer = await documentJsInterop.CreateDocumentNormalizer();
Detect document edges.
Quadrilateral? result = await normalizer.DetectCanvas(canvas);
Rectify the document based on the detected edges.
IJSObjectReference rectifiedDocument = await normalizer.RectifyCanvas(canvas, result.location);
API
Quadrilateral Class
Represents the coordinates of the four corners of a quadrilateral.
DocumentNormalizer Class
Task<Quadrilateral?> DetectCanvas(IJSObjectReference canvas)
: Detects document edges from a canvas.Task<IJSObjectReference> RectifyCanvas(IJSObjectReference canvas, string location)
: Rectifies a document based on the detected edges.Task SetFilter(string filter)
: Sets the filter for document edge detection.Task ShowDocumentEditor(string elementId, IJSObjectReference imageCanvas, string location)
: Shows the document edge editor.RegisterCallback(ICallback callback)
: Registers a callback function for receiving the coordinates of the four corners of a document.Task ShowRectifiedDocument(string elementId, IJSObjectReference rectifiedDocument)
: Displays the rectified document within a specified HTML element.
DocumentJsInterop Class
Task LoadJS()
: Loads the Dynamsoft Document Normalizer JavaScript library.Task SetLicense(string license)
: Sets the license key.Task LoadWasm()
: Loads the Dynamsoft Document Normalizer WebAssembly module.Task<MrzRecognizer> CreateDocumentNormalizer()
: Creates a Document Normalizer instance.
Example
Build
cd RazorDocumentLibrary
dotnet build --configuration Release
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net7.0
- Microsoft.AspNetCore.Components.Web (>= 7.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.
Version | Downloads | Last updated |
---|
- Updated README.md