ZBar.Blazor 1.1.0

dotnet add package ZBar.Blazor --version 1.1.0
                    
NuGet\Install-Package ZBar.Blazor -Version 1.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="ZBar.Blazor" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZBar.Blazor" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ZBar.Blazor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZBar.Blazor --version 1.1.0
                    
#r "nuget: ZBar.Blazor, 1.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.
#:package ZBar.Blazor@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZBar.Blazor&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ZBar.Blazor&version=1.1.0
                    
Install as a Cake Tool

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

  1. Include the Zbar.Blazor library as a dependency or install through NuGet to your Blazor client application project.

  2. 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.

  1. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.1.0 222 8/16/2025
1.0.0 183 7/16/2025