ZBar.Blazor
1.1.0
dotnet add package ZBar.Blazor --version 1.1.0
NuGet\Install-Package ZBar.Blazor -Version 1.1.0
<PackageReference Include="ZBar.Blazor" Version="1.1.0" />
<PackageVersion Include="ZBar.Blazor" Version="1.1.0" />
<PackageReference Include="ZBar.Blazor" />
paket add ZBar.Blazor --version 1.1.0
#r "nuget: ZBar.Blazor, 1.1.0"
#:package ZBar.Blazor@1.1.0
#addin nuget:?package=ZBar.Blazor&version=1.1.0
#tool nuget:?package=ZBar.Blazor&version=1.1.0
ZBar.Blazor
Try the demo to see what ZBar.Blazor can do!
ZBar.Blazor provides easy to use razor components that allow developers to add fully featured barcode scanning capabilities to their Blazor WASM applications in minutes. This project uses zbar-wasm which compiles zbar into native web assembly. This allows developers to utalize the client's web browser to efficiently scan image data for barcode information. ZBar.Blazor is simple to use but flexible and powerful, providing access to all of ZBar's features through a Razor/C# API and without the need to write any JavaScript code.
Barcode Support
ZBar.Blazor supports scanning the following types of barcodes:
- UPC-A, UPC-E
- ISBN-13, ISBN-10
- EAN-13, EAN-8, EAN-5, EAN-2
- I25
- GS1 DataBar
- GS1 DataBar Expanded
- Code 128, Code 93, Code 39
- QR Code
Quickstart
Include the Zbar.Blazor library as a dependency or install through NuGet to your Blazor client application project.
Reference the ZBar module loader script in your Blazor client application's index html page:
<script src="_content/ZBar.Blazor/zbar.js"></script>
This script reference should be placed below the blazor.webassembly.js module loader script.
- Add the ZBarImage or ZBarCamera component to any page in your Blazor client application and bind a function to the OnBarcodesFound event:
@using ZBar.Blazor.Dtos
@*Use ZBarImage to scan image files for barcode information*@
<ZBarImage OnBarcodesFound="FoundBarcodes" />
@*Use ZBarCamera to scan a video feed for barcode information*@
<ZBarCamera OnBarcodesFound="FoundBarcodes" />
@code {
private void FoundBarcodes(ScanResult scanResult)
{
// Scanned barcode information is accessable in the ScanResult object
}
}
Refer to the sandbox demo for details on how to provide image sources to ZBarImage and video feeds to ZBarCamera.
Version Table
Refer to the table below to see which versions of zbar-wasm and zbar are used by this project.
| ZBar.Blazor | zbar-wasm | zbar |
|---|---|---|
| v1.0.0 | v0.11.0 | v0.23.93 |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.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.