Skip to content

aspose-barcode/agentic-net-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aspose.BarCode for .NET — Agentic Examples

Agentic, AI-generated, compiler-validated C# examples for the Aspose.BarCode for .NET API. Every example in this repository compiles and runs successfully against the Aspose.BarCode NuGet package on .NET 9.

About Aspose.BarCode for .NET

Aspose.BarCode for .NET is a powerful barcode generation and recognition library for .NET applications. It enables developers to generate, read, and process barcodes programmatically without any third-party dependencies.

Key capabilities:

  • Generate barcodes for 60+ symbologies including Code128, QR Code, DataMatrix, PDF417, Aztec, EAN, UPC, Code39, ITF14, and more
  • Read and recognize barcodes from images, PDFs, and memory streams
  • Control barcode appearance — size, resolution, colors, padding, rotation, and XDimension
  • Configure checksum settings per symbology
  • Export barcode images as PNG, JPEG, SVG, EMF, TIFF, and BMP
  • Embed barcodes into PDF documents, Word files, and PowerPoint presentations
  • Work with complex barcode types — Swiss QR Bill, Mailmark, HIBC LIC, GS1 Composite, MaxiCode
  • Serialize and deserialize barcode generator and reader configurations to XML

Install

dotnet add package Aspose.BarCode

Or via NuGet Package Manager:

Install-Package Aspose.BarCode

Requires .NET SDK 9.0 or later.

Statistics

Metric Value
Total Examples 1124
Categories 21
Overall Pass Rate 100.0%
Last Updated 2026-04-27

Repository Structure

agents.md
README.md
+-- barcode-appearance-customization/
+-- barcode-checksum-control/
+-- barcode-color-customization/
+-- barcode-configuration-serialization/
+-- barcode-reading-properties/
+-- barcode-recognition-basics/
+-- barcode-recognition-performance/
+-- barcode-recognition-xml-serialization/
+-- barcode-saving-and-export/
+-- barcode-size-and-resolution/
+-- barcode-text-customization/
+-- gs1-barcode-types/
+-- hibc-lic-barcode/
+-- mailmark-four-state-barcode/
+-- mailmark-two-dimensional-barcode/
+-- maxicode-barcode/
+-- one-dimensional-barcode-types/
+-- postal-barcode-types/
+-- special-barcode-recognition-settings/
+-- swiss-qr-code/
+-- two-dimensional-barcode-types/

Categories

Category Examples Pass Rate Details
Barcode Appearance Customization 30 100.0% agents.md
Barcode Checksum Control 30 100.0% agents.md
Barcode Color Customization 28 100.0% agents.md
Barcode Configuration Serialization 30 100.0% agents.md
Barcode Reading Properties 50 100.0% agents.md
Barcode Recognition Basics 75 100.0% agents.md
Barcode Recognition Performance 81 100.0% agents.md
Barcode Recognition XML Serialization 35 100.0% agents.md
Barcode Saving and Export 30 100.0% agents.md
Barcode Size and Resolution 34 100.0% agents.md
Barcode Text Customization 29 100.0% agents.md
GS1 Barcode Types 34 100.0% agents.md
HIBC LIC Barcode 35 100.0% agents.md
Mailmark Four State Barcode 29 100.0% agents.md
Mailmark Two Dimensional Barcode 34 100.0% agents.md
MaxiCode Barcode 34 100.0% agents.md
One Dimensional Barcode Types 126 100.0% agents.md
Postal Barcode Types 90 100.0% agents.md
Special Barcode Recognition Settings 48 100.0% agents.md
Swiss QR Code 28 100.0% agents.md
Two Dimensional Barcode Types 214 100.0% agents.md

How to Use

Each example is a self-contained C# file. Clone the repository and run any example directly:

git clone https://github.com/aspose-barcode/agentic-net-examples.git
cd agentic-net-examples

# Navigate to a category
cd barcode-recognition-basics

# Create a console project, add the package, and run an example
dotnet new console -o ExampleRunner
cd ExampleRunner
dotnet add package Aspose.BarCode

# Copy any .cs file from the category as Program.cs and run
cp ../generate-code128-barcode-and-save-as-png.cs Program.cs
dotnet run

Example

Generate a Code128 barcode and save it as a PNG file:

using System;
using Aspose.BarCode.Generation;

class Program
{
    static void Main()
    {
        using (var generator = new BarcodeGenerator(EncodeTypes.Code128, "1234567890"))
        {
            generator.Parameters.Barcode.XDimension.Point = 2f;
            generator.Parameters.Barcode.BarHeight.Point = 50f;
            generator.Save("code128.png");
            Console.WriteLine("Barcode saved as code128.png");
        }
    }
}

Read a barcode from an image file:

using System;
using Aspose.BarCode.BarCodeRecognition;

class Program
{
    static void Main()
    {
        using (var reader = new BarCodeReader("barcode.png", DecodeType.AllSupportedTypes))
        {
            foreach (var result in reader.ReadBarCodes())
            {
                Console.WriteLine($"Type: {result.CodeTypeName}");
                Console.WriteLine($"Text: {result.CodeText}");
            }
        }
    }
}

For AI Coding Agents

This repository includes an agents.md file at the root and in each category folder. These files provide AI coding agents with:

  • Required namespaces and using directives for each category
  • Correct API property paths and patterns
  • Common pitfalls and prohibited patterns
  • Example code fragments for key operations

If you are an AI coding agent generating Aspose.BarCode for .NET code, read the relevant agents.md before generating examples to avoid common API mistakes.

Prerequisites

  • .NET SDK 9.0 or later
  • Aspose.BarCode for .NET 26.4.0 (via NuGet)

A valid Aspose license is required for production use. For evaluation, examples run without a license but output may include watermarks on generated barcode images.

Agentic .NET Ecosystem

Other Aspose products with agentic, build-validated example repositories:

Product Repository Focus
Aspose.Words for .NET aspose-words/agentic-net-examples Word processing, DOCX, mail merge
Aspose.Cells for .NET aspose-cells/agentic-net-examples Spreadsheets, Excel, charts
Aspose.HTML for .NET aspose-html/agentic-net-examples HTML conversion, DOM editing
Aspose.Imaging for .NET aspose-imaging/agentic-net-examples Image conversion, manipulation
Aspose.Slides for .NET aspose-slides/agentic-net-examples Presentations, PowerPoint
Aspose.Email for .NET aspose-email/agentic-net-examples Email, calendars, messaging
Aspose.PDF for .NET aspose-pdf/agentic-net-examples PDF creation, conversion and manipulation

Resources


Maintained by agent-aspose-barcode-examples · Generated and validated by the Aspose.BarCode Examples Generator Agent

About

Agent-generated C# examples for Aspose.BarCode for .NET — compiled, executed, and validated by an agentic pipeline. Includes an agents.md guide for AI coding agents.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages