Generate Barcode in asp.net MVC (display as image in html)
View (DisplayBarcode.cshtml) should be like the following
Barcode can be generated very easily using zxing. Zxing is open source library which supports decoding and generating of barcodes (like QR Code, PDF 417, EAN, UPC, Aztec, Data Matrix, Codabar) within images.
The project is a port of the java based barcode reader and generator library ZXing.
You can find the project herehttps://github.com/zxing/zxing
There is a mirror of the repository at github:
https://github.com/micjahn/ZXing.Net
The following barcodes are supported by the decoder:
UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 93, Code 128, ITF, Codabar, MSI, RSS-14 (all variants), QR Code, Data Matrix, Aztec and PDF-417.
The encoder supports the following formats:
UPC-A, EAN-8, EAN-13, Code 39, Code 128, ITF, Codabar, Plessey, MSI, QR Code, PDF-417, Aztec, Data Matrix
Steps for generating barcode.
The project is a port of the java based barcode reader and generator library ZXing.
You can find the project herehttps://github.com/zxing/zxing
There is a mirror of the repository at github:
https://github.com/micjahn/ZXing.Net
The following barcodes are supported by the decoder:
UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 93, Code 128, ITF, Codabar, MSI, RSS-14 (all variants), QR Code, Data Matrix, Aztec and PDF-417.
The encoder supports the following formats:
UPC-A, EAN-8, EAN-13, Code 39, Code 128, ITF, Codabar, Plessey, MSI, QR Code, PDF-417, Aztec, Data Matrix
Steps for generating barcode.
- Create a new MVC Project
- Right click on project in solution explorer and click. Manage nuget Packages
- click on browse tab. Search for zxing.net
- Click on install button on right side
OR you can use the following command in package manager console to install zxing.net in your project
PM> Install-Package ZXing.Net -Version 0.16.4
Add the following Action Methods to your controller.PM> Install-Package ZXing.Net -Version 0.16.4
1 | using MVC_CRUD_ADO.DAL; |
View (DisplayBarcode.cshtml) should be like the following
1 | @{ |
5 Comments
Dear sir;
ReplyDeleteDue you respectfully I beg to say that. I hope you are well. sir how can we travel table data from Ms sql server through barcode into ASP.Net MVC or C# window form.
Good Post. I like your blog. Thanks for Sharing
ReplyDelete.NET Training Institute in Noida
In addition to generating barcodes for various image formats, I can also provide pdf barcode generate here.
ReplyDeletehow to show text in the bottom of barcode (Zxing)
ReplyDeletevar writer = new ZXing.BarcodeWriter() { Format = BarcodeFormat.CODE_128 };
ReplyDeleteshow error at BarcodeWriter
please help me
Post a Comment