Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
To perform barcode recognition using the Aspose.BarCode.Cloud SDK for Dart, you need to set the source of the barcode image. Methods of this SDK support loading barcode images from multiple sources, such as file URL, file, and base64 encoded data. This guide provides detailed examples on how to set barcode image source through different API methods.
import 'dart:io';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final jwtToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (jwtToken != null) {
return Configuration(accessToken: jwtToken);
} 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 config = makeConfiguration();
final scanApi = ScanApi(ApiClient(config));
final barcodeImageUrl =
"https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png";
final BarcodeResponseList result = await scanApi.scan(barcodeImageUrl);
if (result.barcodes.isNotEmpty) {
final barcode = result.barcodes[0];
print(
"File '$barcodeImageUrl' recognized, results: value: '${barcode.barcodeValue}', type: ${barcode.type}");
} else {
print("File '$barcodeImageUrl' recognized, but no barcodes found.");
}
}
import 'dart:convert';
import 'dart:io';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final jwtToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (jwtToken != null) {
return Configuration(accessToken: jwtToken);
} 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 config = makeConfiguration();
final scanApi = ScanApi(ApiClient(config));
final fileName =
File("${Directory.current.path}${Platform.pathSeparator}qr.png")
.absolute
.path;
final fileBytes = File(fileName).readAsBytesSync();
final imageBase64 = base64Encode(fileBytes);
final scanBase64Request = ScanBase64Request(imageBase64);
final result = await scanApi.scanBase64(scanBase64Request);
print(
"File '$fileName' recognized, result: '${result.barcodes[0].barcodeValue}'");
}
import 'dart:io';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final jwtToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (jwtToken != null) {
return Configuration(accessToken: jwtToken);
} 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 config = makeConfiguration();
final scanApi = ScanApi(ApiClient(config));
final file =
await File("${Directory.current.path}${Platform.pathSeparator}qr.png")
.readAsBytes();
final BarcodeResponseList result = await scanApi.scanMultipart(file);
print("File recognized, result: '${result.barcodes[0].barcodeValue}'");
}
import 'dart:io';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final jwtToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (jwtToken != null) {
return Configuration(accessToken: jwtToken);
} 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 config = makeConfiguration();
final recognizeApi = RecognizeApi(ApiClient(config));
final result = await recognizeApi.recognize(
DecodeBarcodeType.QR,
"https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png",
);
if (result.barcodes.isNotEmpty) {
print("File recognized, result: '${result.barcodes[0].barcodeValue}'");
} else {
print("No barcodes were recognized.");
}
}
import 'dart:convert';
import 'dart:io';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final jwtToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (jwtToken != null) {
return Configuration(accessToken: jwtToken);
} 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 config = makeConfiguration();
final recognizeApi = RecognizeApi(ApiClient(config));
final fileName =
File("${Directory.current.path}${Platform.pathSeparator}qr.png")
.absolute
.path;
final fileBytes = File(fileName).readAsBytesSync();
final imageBase64 = base64Encode(fileBytes);
final recognizeBase64Request = RecognizeBase64Request(
[DecodeBarcodeType.QR],
imageBase64,
);
final BarcodeResponseList result =
await recognizeApi.recognizeBase64(recognizeBase64Request);
print(
"File '$fileName' recognized, result: '${result.barcodes[0].barcodeValue}'");
}
import 'dart:io';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final jwtToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (jwtToken != null) {
return Configuration(accessToken: jwtToken);
} 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 config = makeConfiguration();
final recognizeApi = RecognizeApi(ApiClient(config));
final file =
await File('${Directory.current.path}${Platform.pathSeparator}qr.png')
.readAsBytes();
final BarcodeResponseList result =
await recognizeApi.recognizeMultipart(DecodeBarcodeType.QR, file);
if (result.barcodes.isNotEmpty) {
final barcode = result.barcodes[0];
print(
"File recognized, results: value: '${barcode.barcodeValue}', type: ${barcode.type}");
} else {
print("File recognized, but no barcodes found.");
}
}
Using the Aspose.BarCode.Cloud SDK for .NET, you can easily load and recognize barcode images in file URL, file, and base64 encoded formats.
Optimize your barcode recognition workflows by selecting the most appropriate method based on your specific image format and application requirements.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.