Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
This documentation explains how to customize the appearance of barcodes using the Aspose.BarCode Cloud SDK for .NET. It provides details on the available methods, customization options, and examples of usage.
When generating a barcode, you can customize various aspects of its appearance using the properties of the request classes.
Key Properties:
QR
, Aztec
, Pdf417
, Code39
, etc).Png
, Jpeg
, Svg
).AliceBlue
or #FF000000
).Below
, Above
, None
).Pixel
, Inch
, Millimeter
).using Aspose.BarCode.Cloud.Sdk.Api;
using Aspose.BarCode.Cloud.Sdk.Interfaces;
using Aspose.BarCode.Cloud.Sdk.Model;
using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
namespace GenerateSnippets;
internal static class Program
{
private static Configuration MakeConfiguration()
{
var config = new Configuration();
string? envToken = Environment.GetEnvironmentVariable("TEST_CONFIGURATION_ACCESS_TOKEN");
if (string.IsNullOrEmpty(envToken))
{
config.ClientId = "Client Id from https://dashboard.aspose.cloud/applications";
config.ClientSecret = "Client Secret from https://dashboard.aspose.cloud/applications";
}
else
{
config.JwtToken = envToken;
}
return config;
}
public static async Task Main(string[] args)
{
string fileName = Path.GetFullPath(Path.Join("Tests", "test_data",
"qr.png"
));
GenerateApi generateApi = new GenerateApi(MakeConfiguration());
var generated = await generateApi.GenerateAsync( barcodeType: EncodeBarcodeType.QR,
data: "Aspose.BarCode.Cloud",
imageFormat: BarcodeImageFormat.Png,
foregroundColor: "Black",
backgroundColor: "White",
textLocation: CodeLocation.Below,
resolution: 300,
imageHeight: 200,
imageWidth: 200);
await using FileStream stream = File.Create(fileName);
await generated.CopyToAsync(stream);
Console.WriteLine($"File '{fileName}' generated.");
}
}
Result Image is:
using Aspose.BarCode.Cloud.Sdk.Api;
using Aspose.BarCode.Cloud.Sdk.Interfaces;
using Aspose.BarCode.Cloud.Sdk.Model;
using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
namespace GenerateSnippets;
internal static class Program
{
private static Configuration MakeConfiguration()
{
var config = new Configuration();
string? envToken = Environment.GetEnvironmentVariable("TEST_CONFIGURATION_ACCESS_TOKEN");
if (string.IsNullOrEmpty(envToken))
{
config.ClientId = "Client Id from https://dashboard.aspose.cloud/applications";
config.ClientSecret = "Client Secret from https://dashboard.aspose.cloud/applications";
}
else
{
config.JwtToken = envToken;
}
return config;
}
public static async Task Main(string[] args)
{
string fileName = Path.GetFullPath(Path.Join("Tests", "test_data",
"Code39.jpeg"
));
GenerateApi generateApi = new GenerateApi(MakeConfiguration());
var generateParams = new GenerateParams
{
BarcodeType = EncodeBarcodeType.Code39,
EncodeData = new EncodeData { Data = "Aspose", DataType = EncodeDataType.StringData },
BarcodeImageParams = new BarcodeImageParams
{
ForegroundColor = "#FF0000",
BackgroundColor = "#FFFF00",
ImageFormat = BarcodeImageFormat.Jpeg,
RotationAngle = 90
}
};
var generated = await generateApi.GenerateBodyAsync(generateParams);
await using FileStream stream = File.Create(fileName);
await generated.CopyToAsync(stream);
Console.WriteLine($"File '{fileName}' generated.");
}
}
Result Image is:
using Aspose.BarCode.Cloud.Sdk.Api;
using Aspose.BarCode.Cloud.Sdk.Interfaces;
using Aspose.BarCode.Cloud.Sdk.Model;
using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
namespace GenerateSnippets;
internal static class Program
{
private static Configuration MakeConfiguration()
{
var config = new Configuration();
string? envToken = Environment.GetEnvironmentVariable("TEST_CONFIGURATION_ACCESS_TOKEN");
if (string.IsNullOrEmpty(envToken))
{
config.ClientId = "Client Id from https://dashboard.aspose.cloud/applications";
config.ClientSecret = "Client Secret from https://dashboard.aspose.cloud/applications";
}
else
{
config.JwtToken = envToken;
}
return config;
}
public static async Task Main(string[] args)
{
string fileName = Path.GetFullPath(Path.Join("Tests", "test_data",
"Pdf417.svg"
));
GenerateApi generateApi = new GenerateApi(MakeConfiguration());
var generated = await generateApi.GenerateMultipartAsync(barcodeType: EncodeBarcodeType.Pdf417,
data: "Aspose.BarCode.Cloud",
textLocation: CodeLocation.Above,
imageFormat: BarcodeImageFormat.Svg
);
await using FileStream stream = File.Create(fileName);
await generated.CopyToAsync(stream);
Console.WriteLine($"File '{fileName}' generated.");
}
}
Result Image is:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.