BlazorBarcodes 1.0.2
See the version list below for details.
dotnet add package BlazorBarcodes --version 1.0.2
NuGet\Install-Package BlazorBarcodes -Version 1.0.2
<PackageReference Include="BlazorBarcodes" Version="1.0.2" />
paket add BlazorBarcodes --version 1.0.2
#r "nuget: BlazorBarcodes, 1.0.2"
// Install BlazorBarcodes as a Cake Addin #addin nuget:?package=BlazorBarcodes&version=1.0.2 // Install BlazorBarcodes as a Cake Tool #tool nuget:?package=BlazorBarcodes&version=1.0.2
BlazorBarcodes
Provides blazor component for rendering 1D & 2D codes.
This is a really simple wrapper around huysentruitw´s Barcoder and as such supports the same barcode types, which at this time are:
- 2 of 5
- Aztec Code
- Codabar
- Code 39
- Code 93
- Code 128
- Code 128 GS1
- Data Matrix (ECC 200)
- Data Matrix GS1
- EAN 8
- EAN 13
- KIX (used by PostNL)
- PDF 417
- QR Code
- RM4SC (Royal Mail 4 State Code)
- UPC A
- UPC E
Targets
.Net 5
Install
PM> Install-Package BlazorBarcodes
Usage
Add the following using statements.
@using BlazorBarcodes
@using BlazorBarcodes.Barcodes
@using BlazorBarcodes.Encoders
Pass a string content and either a BarcodeType(enum), Encoder or encoding function to the component.
<BarcodeComponent Style="width:200px;height:200px"
BarcodeType="@BarcodeTypes.DataMatrix"
Content="Hello World!">
</BarcodeComponent>
The codes are renderer as SVG by default.
If you´d like to quickly play around with the different barcodes, you create an easy selection like this.
<div style="display:flex; flex-direction:column">
<input type="text" @bind="Content">
<select @bind="Type">
@foreach (var barcode in BarcoderWrapper.Barcodes.Barcode.All)
{
<option value="@barcode.Type" disabled="@(!barcode.Encoder.CanEncode(Content, out string error))">
@(string.Format("{0}{1}", barcode.Name, error is not null ? $": {error}" : ""))
</option>
}
</select>
<BarcodeComponent Style="width:200px;height:200px"
BarcodeType="@Type"
Content="@Content">
</BarcodeComponent>
</div>
@code {
public BarcodeTypes Type { get; set; }
public string Content { get; set; } = "";
}
Options
Passed to the Barcoder renderer
bool IncludeEANContentAsText
Shows exception message instead of the rendered code, in case the content is not compatible with the encoder
bool ShowExceptionMessages
Encoders
The encoding functions in Barcoder have been wrapped in classes implementing my own IEncoder interface, since I wanted to be able to pass encoders around and also saw it as an opportunity to play around with C# source code generators.
You can still use pass the pre-existing encode methods to the component though.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.