Generate Barcode using C#

Barcodes play a crucial role in product identification, offering machine-readable representations of data. Common formats such as Code 128, QR, Data Matrix, and Aztec are extensively utilized across various industries. In this guide, you’ll discover how to generate barcodes in C# and effortlessly customize their designs using the powerful Plugins de BarCode.

Taula de continguts

C# Barcode Generator API - Free Download

L’Aspose.BarCode per a la biblioteca .NET és una API integral dissenyada per generar i escanejar codi de bar, fent-ho l’ideal C# Free Barcode Generator.

  • El codi 128
  • El codi 11
  • El codi 39
  • El QR
  • Matriu de dades
  • El 13
  • El 8
  • ITF 14
  • Pd417
  • Molt més.

You can Descàrrega de l’API gratuïta, or install it directly in your .NET application using El nou for a C# Barcode Generator NuGet Free solution:

PM> Install-Package Aspose.Barcode

Com generar un codi de bar amb C#

La generació d’un codi de bar amb l’Aspose Plugin és senzill i eficaç. Segueix aquests passos per crear un codi a bar mitjançant C#, utilitzant Barcode Generator C# Source Code:

  • Instantiate the Barcades generadors class, specifying the desired barcode type and text in the constructor.
  • Configureu les característiques del codi de bar, com ara la resolució i la mida.
  • Generate the barcode using the BarcodeGenerador.Save(String) method.

Aquí teniu una mostra de codi que demostra com generar un codi de bar amb C# Barcode Generator:

Generate Barcode in C#

Com generar un codi de barra QR utilitzant C#

Crear un codi de barra QR segueix un procés similar a generar altres tipus de codi de barra:

  • Instantiate the BarcodeGenerator class, specifying the barcode type as Tècnics.QR.
  • Generate the barcode using the BarcodeGenerator.Save(String) method.

Aquí teniu una mostra de codi per a la generació d’un codi de barra QR utilitzant Aplicació de barcode en C# .NET:

Generate QR Barcode in C#

Personalitza l’aparició d’un codi de bar en C#

Personalitzar l’aparença d’un codi de barra és fàcil amb l’Aspose Plugin. Es pot modificar la seva lletra, el color de l’avantguarda, el color de fons i el color del text. Aquí són els passos:

  • Instantiate the BarcodeGenerator class.
  • Adjust the barcode’s appearance using the BarcodeGenerator.Parameters properties, such as BarcodeGenerador.Paràmetres.BackColor.
  • Generate the barcode using the BarcodeGenerator.Save(String).

Here’s a code sample for generating a customized Aztec barcode using Barcode Generator C#:

Generate Aztec Barcode in C#

Afegir capció en Barcodes utilitzant C#

Incorporar capcions en codis de barra pot proporcionar un context addicional, i el Plugin d’Aspose fa que aquest procés sigui insegur:

  • Instantiate the BarcodeGenerator class.
  • Set the barcode’s text and type in the constructor of Barcades generadors.
  • Utilize the CaptionAbove or CaptionBelow properties to configure the caption.
  • Save the barcode using the BarcodeGenerator.Save(String) method.

Aquí teniu una mostra de codi per afegir una nota a un codi de bar amb C# Barcode Generator:

Generate Barcode with Caption in C#

Conclusió

In this article, you learned how to programmatically generate barcodes using C#. You also explored how to customize their appearance and add captions. For more detailed information, visit the Aspose.BarCode Plugin Documentació to enhance your barcode generation capabilities with .NET Core Barcode Generator options. Additionally, explore how to generate barcode in C# windows application and utilize other features like the C# Barcode Scanner API and C# Barcode Generator Open Source for comprehensive barcode solutions.

More in this category