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 Príslušenstvo.BarCode Plugins.

Tabuľka obsahu

C# Barcode Generator API - zadarmo Stiahnuť

Aspose.BarCode pre .NET knižnicu je komplexný API navrhnutý pre generáciu a skenovanie čárového kódu, čo robí ideálny C# Free Barcode Generator.

  • Kód 128
  • Kód 11
  • Kód 39
  • QR
  • Údaje Matrix
  • EÚ 13
  • Evan 8
  • ITF 14
  • PDF číslice 417
  • Mnoho viac.

You can Stiahnuť API zadarmo, or install it directly in your .NET application using NuGet for a C# Barcode Generator NuGet Free solution:

PM> Install-Package Aspose.Barcode

Ako vytvoriť barový kód pomocou C#

Vytvorenie čárového kódu s aplikáciou Aspose Plugin je jednoduché a efektívne. postupujte podľa týchto krokov, aby ste vytvorili čarovný kód pomocou C#, pomocou C# Barcode Generator Source Code:

  • Instantiate the Barcode generátor class, specifying the desired barcode type and text in the constructor.
  • Nastavenie funkcií čiarového kódu, ako je rozlíšenie a veľkosť.
  • Generate the barcode using the Barcode generátor.Save(String) method.

Tu je vzorka kódu, ktorá ukazuje, ako vytvoriť čárový kód pomocou C# Barcode Generator:

Generate Barcode in C#

Ako vytvoriť QR Barcode pomocou C#

Vytvorenie QR čárového kódu nasleduje podobný proces pri vytváraní iných typov čárového kódu.

  • Instantiate the BarcodeGenerator class, specifying the barcode type as Príslušenstvo pre: QR.
  • Generate the barcode using the BarcodeGenerator.Save(String) method.

Tu je vzorka kódu na generovanie QR kódov pomocou Barcode Application v C# .NET:

Generate QR Barcode in C#

Prispôsobte vzhľad čárového kódu v C#

Prispôsobenie vzhľadu čiarového kódu je jednoduché s aplikáciou Aspose Plugin. Môžete zmeniť jeho písmo, farbu prednej časti, farbu pozadia a farbu textu. Tu sú kroky:

  • Instantiate the BarcodeGenerator class.
  • Adjust the barcode’s appearance using the BarcodeGenerator.Parameters properties, such as BarcodeGenerator.Parametry.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#

Pridajte Caption do Barcodes pomocou C#

Integrovanie capcií do barových kódov môže poskytnúť dodatočný kontext, a Aspose Plugin robí tento proces bezvýznamným.

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

Tu je vzorka kódu pre pridanie nápisu na čárový kód pomocou C# Barcode Generator:

Generate Barcode with Caption in C#

Záver

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 dokumentácia 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