2D Barcode Writer for .NET

Introduction to 2D Barcode Writer for .NET

The 2D Barcode Writer for .NET is a plugin that enables developers to generate 2D barcodes in their .NET applications. This guide provides an overview of the available features and explains how to perform common tasks using code examples.

Supported 2D Barcode Types

The 2D Barcode Writer for .NET supports several types of 2D barcodes, including:

  • QR Code
  • Data Matrix
  • PDF417

Generating 2D Barcodes

To generate a 2D barcode, you can use the BarcodeGenerator class. This class provides several properties that allow you to customize the barcode, such as CodeText, EncodeTypes, and Resolution.

using Aspose.BarCode;

// Create a new instance of BarcodeGenerator
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "https://www.example.com");

// Set the resolution of the barcode
generator.Parameters۔Resolution = 300;

// Save the barcode to an image file
generator.Save("qr_code.png", BarCodeImageFormat.Png);

Customizing 2D Barcodes

You can customize the appearance of the 2D barcode by using various properties provided by the BarcodeGenerator class. For example, you can change the background color of the barcode.

using Aspose.BarCode;

// Create a new instance of BarcodeGenerator
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "https://www.example.com");

// Set the background color of the barcode
generator.Parameters.BackColor = Color.Blue;

// Set the auto-size mode
generator.Parameters.AutoSizeMode = AutoSizeMode.Nearest;

// Save the barcode to an image file
generator.Save("qr_code.png", BarCodeImageFormat.Png);
 English