A Blazor wrapper for the JavaScript library bwip-js (Barcode Writer in Pure Javascript)
https://ricardovalero95.github.io/Blazor.BwipJs/
- .NET 5.0 or newer
Install the package
dotnet add package Blazor.BwipJs
Add a reference to the JavaScript library in index.html
(client-side) or _Host.cshtml
(server-side) in the body
tag after the _framework
reference
<script src="https://cdn.jsdelivr.net/npm/bwip-js@2.1.1/dist/bwip-js.min.js"></script>
Add a reference to the package in _Imports.razor
@using Blazor.BwipJs
Register the service
- in
Program.cs
(client-side)
builder.Services.AddBlazorBwipJs();
- or in
Startup.cs
(server-side)
services.AddBlazorBwipJs();
<Barcode BarcodeType="@BarcodeType"
Text="@Text"
IncludeText="@IncludeText"
TextXAlign="@TextXAlign"
TextYAlign="@TextYAlign"
ScaleX="@ScaleX"
ScaleY="@ScaleY"
Height="@Height"
Width="@Width"
Rotate="@Rotate" />
This Blazor wrapper was built based on
- learning about wrapping a JavaScript library
- learning about GitHub actions and versioning
- using various Blazor libraries
- sample website (template and components)
- GitHub Actions
- JavaScript interop and file structure
- using GitHub docs
- This is a work in progress
- I've only tested it with client-side Blazor Wasm
- This is my first ever public repo, if you have any suggestions please contact me on Gitter or create an issue
- I'm not experienced with GitHub Actions or Azure Pipelines if you want to help me with semantic releases and/or versioning please do
- Other things I don't like are:
- how
Enums
are used - handling JavaScript errors
- how