| name | aspose-barcode-examples |
|---|---|
| description | AI-friendly C# code examples for Aspose.BarCode for .NET |
| language | csharp |
| framework | net10.0 |
| package | Aspose.BarCode |
AI-friendly repository containing validated C# examples for Aspose.BarCode for .NET API.
You are a C# developer specializing in barcode generation and recognition using Aspose.BarCode for .NET. When working in this repository:
- Each
.csfile is a standalone Console Application - do not create multi-file projects - All examples must compile and run without errors using
dotnet buildanddotnet run - Follow the conventions, boundaries, and anti-patterns documented below exactly
- Use the Command Reference section for build/run commands
This agent generates validated C# examples for the following Aspose.BarCode for .NET operations:
- 1D Barcode Generation — Code128, Code39, EAN-13, EAN-8, UPC-A, UPC-E, ITF, Codabar, and 50+ symbologies
- 2D Barcode Generation — QR Code, DataMatrix, PDF417, Aztec, MaxiCode, GS1 DataBar
- Postal Barcodes — Mailmark (4-State and 2D), USPS, Australia Post, Deutsche Post
- Special Barcodes — HIBC LIC, Swiss QR Code, PatchCode, Pharmacode
- Barcode Recognition — Read barcodes from images, PDFs, and streams with quality/performance control
- PDF Integration — Embed barcodes as static images or interactive ButtonField form controls
- Image Customization — Colors, resolution, caption, padding, X-dimension, rotation
- Batch & Export — Multiple barcodes in one operation; XML configuration import/export
Input: Natural language description of a barcode operation
Output: Standalone C# console application (compiles and runs with dotnet run)
This repository contains 1124 working code examples demonstrating Aspose.BarCode for .NET capabilities.
Statistics (as of 2026-07-04):
- Total Examples: 1124
- Categories: 21
- Overall Pass Rate: 100.0%
- Package Version: Aspose.BarCode 26.6.0
- Examples: 30
- Guide: agents.md
- Examples: 30
- Guide: agents.md
- Examples: 28
- Guide: agents.md
- Examples: 30
- Guide: agents.md
- Examples: 50
- Guide: agents.md
- Examples: 75
- Guide: agents.md
- Examples: 81
- Guide: agents.md
- Examples: 35
- Guide: agents.md
- Examples: 30
- Guide: agents.md
- Examples: 34
- Guide: agents.md
- Examples: 29
- Guide: agents.md
- Examples: 34
- Guide: agents.md
- Examples: 35
- Guide: agents.md
- Examples: 29
- Guide: agents.md
- Examples: 34
- Guide: agents.md
- Examples: 34
- Guide: agents.md
- Examples: 126
- Guide: agents.md
- Examples: 90
- Guide: agents.md
- Examples: 48
- Guide: agents.md
- Examples: 28
- Guide: agents.md
- Examples: 214
- Guide: agents.md
using (BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "12345"))
{
generator.Save("barcode.png");
}using Aspose.Drawing;
using Aspose.Drawing.Imaging;
// WRONG: using System.Drawing;BaseEncodeType barcodeType = EncodeTypes.Code128;
// WRONG: EncodeTypes barcodeType = EncodeTypes.Code128;generator.Parameters.Barcode.XDimension.Pixels = 2f;
generator.Parameters.Barcode.BarHeight.Pixels = 50f;
generator.Parameters.Barcode.Padding.Left.Point = 5f;
// WRONG: generator.Parameters.XDimension.Pixels = 2f;generator.Parameters.Border.Color = Aspose.Drawing.Color.Black;
generator.Parameters.Border.Width.Pixels = 2f;
// WRONG: generator.Parameters.BorderColor = Color.Black;- Never use
System.Drawing— always useAspose.Drawing - Never use
EncodeTypesas a variable, field, or parameter type — useBaseEncodeType - Never call
Environment.Exit(1)— useConsole.WriteLinefor failure reporting - Never use
generator.Parameters.BorderColororgenerator.Parameters.BorderWidth - Never use
generator.Parameters.Padding.*— usegenerator.Parameters.Barcode.Padding.* - Never use
generator.Parameters.XDimension— usegenerator.Parameters.Barcode.XDimension - Never use
reader.BarcodeSettings.QualitySettings— usereader.QualitySettingsdirectly - Never use
result.IsCodeTextValid— it does not exist onBarCodeResult - Never use
DeconvolutionMode.Disabled— useDeconvolutionMode.Fast
agents.md
index.json
+-- 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/
dotnet new console -n ExampleProject --framework net10.0
dotnet add package Aspose.BarCode
dotnet build --configuration Release --verbosity minimal
dotnet run<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aspose.BarCode" Version="26.6.0" />
</ItemGroup>
</Project>| Code | Meaning | Fix |
|---|---|---|
CS0721 |
Static type used as parameter | Use BaseEncodeType instead of EncodeTypes |
CS1061 |
Member does not exist on type | Verify property path; check Aspose.BarCode docs |
CS0246 |
Type or namespace not found | Add missing using; use Aspose.Drawing not System.Drawing |
CS1674 |
Type not IDisposable | Remove using from non-disposable types |
Updated: 2026-07-04 | Examples: 1124 | Categories: 21 | Package: Aspose.BarCode 26.6.0
This repository is maintained by automated code generation. Last updated: 2026-07-04 | Total examples: 1124