Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The Aspose.BarCode Cloud SDK for Dart by the GenerateApi
provides methods to generate barcodes to the Uint8List. Then you can work with result in order to obtain the desired outcomes. This API supports various barcode formats and configurations, enabling users to customize barcode generation to fit their needs.
Uint8List
.Below are examples demonstrating how to save the generated barcode stream to a file.
generate
import 'dart:io';
import 'dart:typed_data';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final envToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (envToken != null) {
return Configuration(accessToken: envToken);
} else {
return Configuration(
clientId: "Client Id from https://dashboard.aspose.cloud/applications",
clientSecret:
"Client Secret from https://dashboard.aspose.cloud/applications",
);
}
}
Future<void> main() async {
final configuration = makeConfiguration();
final apiClient = ApiClient(configuration);
final generateApi = GenerateApi(apiClient);
final fileName =
"${Directory.current.path}${Platform.pathSeparator}Code128.jpeg";
final Uint8List response = await generateApi.generate(
EncodeBarcodeType.Code128, "Aspose.BarCode.Cloud");
final file = File(fileName);
file.writeAsBytes(response);
print("File '${file.path}' generated.");
}
generateBody
import 'dart:io';
import 'dart:typed_data';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final envToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (envToken != null) {
return Configuration(accessToken: envToken);
} else {
return Configuration(
clientId: "Client Id from https://dashboard.aspose.cloud/applications",
clientSecret:
"Client Secret from https://dashboard.aspose.cloud/applications",
);
}
}
Future<void> main() async {
final fileName =
"${Directory.current.path}${Platform.pathSeparator}Pdf417.png";
final configuration = makeConfiguration();
final apiClient = ApiClient(configuration);
final generateApi = GenerateApi(apiClient);
final generateParams = GenerateParams(
EncodeBarcodeType.Pdf417,
EncodeData("Aspose.BarCode.Cloud", EncodeDataType.StringData),
BarcodeImageParams()
..foregroundColor = "#FF5733"
..backgroundColor = "#FFFFFF"
..imageFormat = BarcodeImageFormat.Jpeg,
);
final Uint8List response = await generateApi.generateBody(generateParams);
final file = File(fileName);
file.writeAsBytes(response);
print("File '${file.path}' generated.");
}
generateMultipart
import 'dart:io';
import 'dart:typed_data';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final envToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (envToken != null) {
return Configuration(accessToken: envToken);
} else {
return Configuration(
clientId: "Client Id from https://dashboard.aspose.cloud/applications",
clientSecret:
"Client Secret from https://dashboard.aspose.cloud/applications",
);
}
}
Future<void> main() async {
final fileName =
"${Directory.current.path}${Platform.pathSeparator}Pdf417.png";
final configuration = makeConfiguration();
final apiClient = ApiClient(configuration);
final generateApi = GenerateApi(apiClient);
final Uint8List response = await generateApi.generateMultipart(
EncodeBarcodeType.Pdf417, "Aspose.BarCode.Cloud");
final file = File(fileName);
file.writeAsBytes(response);
print("File '${file.path}' generated.");
}
The Aspose.BarCode Cloud SDK for Dart offers a robust solution for generating barcodes in various formats, with flexible configuration options. By using the provided methods, developers can easily create and save barcode images to files, streamlining workflows that require barcode generation. Whether you’re working with simple barcodes like Code128 or more complex ones like QR Codes and DataMatrix, this API provides the tools needed to customize and produce high-quality barcode images.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.