Data Matrix codes are celebrated for their high data density and compact design, making them an excellent choice for applications where space is limited. In this tutorial, we will walk you through the process of programmatically generating Data Matrix codes in C# using the Aspose.BarCode for .NET library. You’ll also learn how to customize the codes and set error correction levels.
Table of Contents
- C# API to Generate Data Matrix Code
- Generate Data Matrix Code in C#
- Generate Data Matrix ECC200 Code in C#
- Get a Free License
- Conclusion
- See Also
C# API to Generate Data Matrix Code
To create a Data Matrix code in C#, we will utilize the Aspose.BarCode for .NET API. This robust library supports the generation and scanning of various 1D and 2D barcodes, providing a comprehensive solution for your barcode needs.
To get started, you can download the DLL or install the library via NuGet with the following command:
PM> Install-Package Aspose.BarCode
Generate Data Matrix Code in C#
Generating a Data Matrix code in C# is a simple process. Follow these steps:
- Create an instance of the BarcodeGenerator class and specify the desired EncodeType.
- Configure the pixel size and encoding mode for the Data Matrix code.
- Save the generated Data Matrix code as a PNG image.
Here’s a code sample demonstrating how to generate a Data Matrix code in C#:
Generate Data Matrix ECC200 Code in C#
To generate a Data Matrix code compliant with the ECC200 standard, follow these steps:
- Instantiate the BarcodeGenerator class, passing the input text and desired EncodeType as parameters.
- Set the pixel size and specify the Data Matrix type as ECC.
- Use the Save method to write the Data Matrix ECC200 barcode.
The following code snippet illustrates how to generate a Data Matrix ECC200 barcode in C#:
Get a Free License
If you’re interested in evaluating the API without limitations, you can request a free temporary license.
Conclusion
In this tutorial, you learned how to generate a Data Matrix code in C#, including various encoding options such as ECC200. For more advanced features and detailed documentation, visit the Aspose documentation. If you have any questions, feel free to reach out on our forum.
See Also
By leveraging the best C# DataMatrix library, you can easily implement dynamic DataMatrix generation in your applications, whether for WinForms, WPF, or .NET MAUI. Start creating high-quality DataMatrix barcodes today for just $99 with the Aspose Plugin!