Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
This documentation covers how to set barcode text in the Aspose.BarCode Cloud SDK for Dart. The Barcode API supports multiple methods to generate barcodes in different formats using GET and POST requests through the GenerateApi
. Barcodes can be generated by specifying various parameters such as barcode type, data to encode, image format and display options. The data encoding process involves defining the type of data and the actual content.
The GenerateApi
interface includes methods for generating barcodes:
dataType
: Specifies the type of data encoding (can be string, base64, or hex). If not set, the data
value is used as plain text.data
: A string that represents the data to be encoded.Value | Description |
---|---|
StringData (Default value) | Plain text |
Base64Bytes | Base64 encoded binary data |
HexBytes | Hexadecimal encoded binary data |
Below are examples to demonstrate barcode generation using the GenerateApi
methods.
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}qr.png";
final configuration = makeConfiguration();
final apiClient = ApiClient(configuration);
final generateApi = GenerateApi(apiClient);
final Uint8List response =
await generateApi.generate(EncodeBarcodeType.QR, "Aspose.BarCode.Cloud");
final file = File(fileName);
file.writeAsBytes(response);
print("File '${file.path}' generated.");
}
Result Image is:
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 postParams = GenerateParams(
EncodeBarcodeType.Pdf417,
EncodeData("QXNwb3NlLkJhckNvZGUuQ2xvdWQ=", EncodeDataType.Base64Bytes),
);
final Uint8List response = await generateApi.generateBody(postParams);
final file = File(fileName);
file.writeAsBytes(response);
print("File '${file.path}' generated.");
}
Result Image is:
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}Code128.png";
final configuration = makeConfiguration();
final apiClient = ApiClient(configuration);
final generateApi = GenerateApi(apiClient);
final Uint8List response = await generateApi.generateMultipart(
EncodeBarcodeType.Code128, "4173706F73652E426172436F64652E436C6F7564",
dataType: EncodeDataType.HexBytes);
final file = File(fileName);
await file.writeAsBytes(response);
print("File '${file.path}' generated.");
}
Result Image is:
This documentation covers how to use the GenerateApi
to set barcodes text.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.