Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aspose-com-gists/47a7d456aa02f46a12bb0eb53ac3ae3e to your computer and use it in GitHub Desktop.

Select an option

Save aspose-com-gists/47a7d456aa02f46a12bb0eb53ac3ae3e to your computer and use it in GitHub Desktop.
Generate High Density Data Matrix Code in .NET
// Generate High Density Data Matrix Code in .NET
// Read the full guide here: https://blog.aspose.com/barcode/generate-high-density-data-matrix-code-in-dotnet/
using System;
using Aspose.BarCode.Generation;
namespace HighDensityDataMatrixDemo
{
class Program
{
static void Main(string[] args)
{
// Initialise the generator for DataMatrix symbology
var generator = new BarCodeGenerator(EncodeTypes.DataMatrix);
// Set the data to encode
generator.CodeText = "1234567890ABCDEFGHIJ";
// High‑density configuration
generator.Parameters.Barcode.DataMatrixEncodeMode = DataMatrixEncodeMode.Auto;
generator.Parameters.Barcode.DataMatrixSize = DataMatrixSize.Size10x10; // smallest possible
generator.Parameters.ImageResolution = 300; // DPI for crisp output
generator.Parameters.Barcode.QRQuietZone = 0; // minimal quiet zone
generator.Parameters.ImageFormat = BarCodeImageFormat.Png;
// Save the barcode image
generator.Save("HighDensityDataMatrix.png");
Console.WriteLine("High density Data Matrix barcode generated successfully.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment