Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More

Neodynamic.Web.MVC.Barcode

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

Neodynamic.Web.MVC.Barcode

Barcode Professional can generate Linear, Postal, MICR and 2D Barcodes for ASP.NET MVC. Visual Studio, VB.NET, C#, Visual Web Developer. Renders barcode images on-fly in formats such as GIF, JPEG, BMP, TIFF, EPS and PNG - Save barcode images in image files as well as in stream objects - VS ReportViewer Local Reports (RDLC) support - Crystal Reports for .NET support - Draw barcode images onto any Graphics object - DPI support - Data-Binding support - Supports for Shared Hosting scenarios using ASP.NET Medium Trust configuration. Barcodes supported: Australia Post 4-state Barcode, ABC Codabar, USS Code 128 A-B-C, USS Code 39, USS Code 93, Data Matrix ECC200, Deutsche Post Identcode, Deutsche Post Leitcode, EAN-13, GTIN-13, EAN-8, GTIN-8, EAN-99, Coupon Barcode, EAN-Velocity, Industrial 2 of 5, Standard 2 of 5, Interleaved 2 of 5, ITF 25, ISBN, Bookland EAN, ISBN-13, ISBN-10, ISMN, ISSN, ITF-14, EAN-14, DUN-14, GTIN-14, JAN-13, JAN-8, MSI, OPC, PDF417, Portable Data File 417, PDF417 Truncated, PLANET, POSTNET, PZN, British Royal Mail 4-State Customer Barcode, RM4SCC, Royal TPG Post KIX 4-State Barcode, SCC-14, Singapore 4-State Postal Code Barcode, SSCC-18, UPC-128, EAN-18, Swiss PostParcel Barcode, UCC-EAN-128, EAN-128, GTIN-128, UPC-A, UPC-E, GTIN-12, USPS Sack Label, USPS Tray Label Barcode, QR Code, USPS FIM, USPS Horizontal Bars, Telepen, Pharmacode, Semacode, Code 32 Italian Pharmacode IMH, USPS Package Identification Code (PIC), FedEx Ground 96, HIBC LIC/PAS, ISBT 128, Italian Post 25, USPS Intelligent Mail Barcode, VICS BOL, VICS Bill of Lading, VICS SCAC PRO, Aztec Code, Compact PDF417, Macro PDF417, Micro PDF417, Micro QR Code, UPS MaxiCode, GS1 DataBar, RSS-14, Matrix 2 of 5, Danish Postal 39, French Postal 39 A/R, GS1 DataMatrix, MICR E-13-B, ALL EAN.UCC Composite Barcodes CC-A, CC-B, CC-C, USPS Intelligent Mail Container Barcode, USPS IMpb, USPS Zip+4, Chinese 2D Han Xin Code, PPN (securPharm), PostMatrix Swiss-QRCode JAB-Code Multicolored 2D-Pharmacode

Version
14.0.25.525
Version published
Maintainers
1
Created

Using Barcode Professional in ASP.NET MVC

There are two ways to render barcode images in your Views, one is through the BarcodeHtmlHelper class where the barcode image is embedded into the HTML returned back to the browser; and the other one is by writing a Controller from where you instantiate BarcodeProfessional class to generate the desired barcode image that will be displayed in the View through an HTML IMG tag.

Barcode Professional can generate most popular Linear (1D), Postal, Component Composite, MICR & 2D Barcode Symbologies including Code 39, Code 128, GS1-128 GS1 DataBar (RSS-14), EAN 13 & UPC, ISBN, ISBT-128, Postal (USPS, British Royal Mail, Mailmark, Australia Post, DHL, FedEx), Data Matrix, QR Code, PDF 417, Aztec Code, UPS MaxiCode, Chinese Han Xin Code, IFA PPN, MICR E-13-B Characters, all EAN/UPC Composite Barcodes (CC-A, CC-B & CC-C), DotCode and many more barcode standards (http://neodynamic.com/barcodes)

If you need further assistance, please contact our team at https://neodynamic.com/support

Using BarcodeHtmlHelper class

  • In your ASP.NET MVC project, add a reference to Neodynamic.Web.MVC.Barcode.dll

  • Then, in the View where you'd like to display the barcode image, add the following using statement at the top:

@using Neodynamic.Web.MVC.Barcode

  • Now, in the View's content, use the BarcodeHtmlHelper.EmbedBarcodeImage method to embed the barcode image. In this snipped code, the barcode type, a.k.a. Symbology, will be QRCode and the value to encode is ABC12345

@Html.Raw(BarcodeHtmlHelper.EmbedBarcodeImage("S="+Symbology.QRCode.ToString() +"&C=ABC12345", "Sample Barcode", "", ""))

NOTE: Please refer to the Barcode HTML Helper Settings for further details on how to contruct the parameter string for BarcodeHtmlHelper.EmbedBarcodeImage http://neodynamic.com/Products/Help/BarcodeAspNet140/index.html

  • That's it! Just view the page on a browser and a QR Code symbol will be displayed.

NOTE: The BarcodeHtmlHelper.EmbedBarcodeImage method creates and embeds a barcode image in PNG format by leveraging browsers Base64 Data URI feature. If you do not want to embed the barcode image or need to render the barcode in another image format like (jpg, gif, etc), then please refer to "Using BarcodeProfessional class in a Controller"

Using BarcodeProfessional class in a Controller

  • In your ASP.NET MVC project, add a reference to Neodynamic.Web.MVC.Barcode.dll

  • Then, create a new Controller called BarcodeGen and paste the following code. In this sample code, we create an instance of BarcodeProfessional class to create a QR Code based on the specified value to encode:

C# public void GetBarcodeImage(string valueToEncode) { //Create an instance of BarcodeProfessional class using (Neodynamic.Web.MVC.Barcode.BarcodeProfessional bcp = new Neodynamic.Web.MVC.Barcode.BarcodeProfessional()) { //Set the desired barcode type or symbology bcp.Symbology = Neodynamic.Web.MVC.Barcode.Symbology.QRCode; //Set value to encode bcp.Code = valueToEncode; //Generate barcode image byte[] imgBuffer = bcp.GetBarcodeImage( System.Drawing.Imaging.ImageFormat.Png); //Write image buffer to Response obj System.Web.HttpContext.Current.Response.ContentType = "image/png"; System.Web.HttpContext.Current.Response.BinaryWrite(imgBuffer); } }

VB.NET Public Sub GetBarcodeImage(valueToEncode As String) 'Create an instance of BarcodeProfessional class Using bcp As New Neodynamic.Web.MVC.Barcode.BarcodeProfessional() 'Set the desired barcode type or symbology bcp.Symbology = Neodynamic.Web.MVC.Barcode.Symbology.QRCode 'Set value to encode bcp.Code = valueToEncode 'Generate barcode image Dim imgBuffer As Byte() = bcp.GetBarcodeImage( System.Drawing.Imaging.ImageFormat.Png) 'Write image buffer to Response obj System.Web.HttpContext.Current.Response.ContentType = "image/png" System.Web.HttpContext.Current.Response.BinaryWrite(imgBuffer) End Using End Sub

  • Now, in the View, we'll use an IMG tag pointing to the GetBarcodeImage method of the BarcodeGen Controller by specifying which value we'd like to encode into a QR Code image. For instance:

Sample Barcode

  • That's it! Just view the page on a browser and a QR Code symbol will be displayed.

FAQs

Package last updated on 27 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts