Carane ngembangake Aplikasi scanner Barcode nggunakake Java SDK. Ngleksanakake kemampuan scan QR ing Aplikasi Web, Seluler lan Desktop.
Ing artikel iki, kita bakal ngrembug babagan cara ngembangake scanner Barcode lan aplikasi scanner kode QR nggunakake Java REST API. Kita ngerti manawa ing ekonomi cepet saiki, Barcode minangka solusi penting lan sregep kanggo vendor lan pedagang kanggo nyimpen rincian produk. Swara taun, dheweke wis kabukten dadi pilihan sing larang regane lan sregep kanggo bisnis. Padha wis nemen apik efficiency lan wis suda overhead. Barcode loro-lorone biaya-efektif lan dipercaya. Antarane keuntungan liyane saka nggunakake BarCode, kasebut ing ngisor iki sawetara liyane kaluwihan saka nggunakake
- Barcode ngilangi kemungkinan kesalahan manungsa
- Nggunakake sistem barcode nyuda wektu latihan karyawan
- Barcode pancen serbaguna lan bisa digunakake kanggo koleksi data sing dibutuhake
- Dheweke ngaktifake kontrol persediaan sing tepat, lan mulane kontrol Persediaan nambah
- Salajengipun, Barcode nyedhiyakake data sing luwih apik yaiku siji barcode bisa nyedhiyakake rincian inventaris lan rega
Sing cocog karo kabeh fitur kasebut, Aspose.BarCode Cloud Java SDK ndayani pangembang Jawa kanggo nggawe uga mindai Barcode online nggunakake basa Jawa. Kaya karo API Cloud liyane, Aspose.BarCode Cloud Java SDK mbutuhake sampeyan ndhaptar akun ing Cloud Dashboard. Yen sampeyan wis ndhaptar akun, sampeyan bisa terus nggunakake. Sawise akun wis siyap, sampeyan bisa nggunakake Layanan Cloud liwat AppKey lan AppSID.
Sampeyan bisa uga nimbang nggunakake panyimpenan Aspose Cloud utawa, nggunakake layanan panyimpenan maya pihak katelu kanggo panyimpenan file lan njupuk.
Simbol Barcode sing Didhukung
SDK ndhukung akeh simbol Barcode (luwih saka 60) kayata EAN, UPC, Codabar, PDF417, QR, MicroQR, Postnet, Planet, RM4SCC, lan sapiturute. format, kayata JPEG, PNG, GIF, BMP, TIFF, EMF, WMF, SVG, EXIF, lan ICON. Kanggo dhaptar lengkap simbol sing didhukung, bukak Aspose.BarCode Cloud Java SDK.
Nggawe Barcode
SDK nawakake sampeyan nggawe gambar barcode Linear, 2D, lan pos ing macem-macem format. Sampeyan bisa nemtokake atribut gambar barcode kaya ambane gambar, dhuwur, gaya wates, lan format gambar output. Sampeyan uga bisa nemtokake jinis barcode lan atribut teks kayata lokasi teks lan gaya font miturut syarat aplikasi sampeyan. Uga nyedhiyakake kemampuan kanggo nyetel dhuwur bar & muter gambar barcode ing sudhut.
Conto ing ngisor iki nuduhake langkah-langkah kanggo nggawe Code39Standard Barcode, diselehake ing alignment Top-Center kaca. Werna teks kasebut minangka resolusi Angkatan Laut, Horizontal, lan Vertikal ditemtokake minangka 200. BarColor ditemtokake minangka Oranye, werna latar mburi disetel minangka perak lan format output yaiku format JPEG.
Sadurunge nerusake, disaranake sampeyan ngunjungi link ing ngisor iki amarga token JWT perlu nalika ngakses API nggunakake perintah cURL.
nggulung
curl -X PUT "https://api.aspose.cloud/v3.0/barcode/MySample.jpeg/generate?Type=Code39Standard&Text=BarCode%20processing&TextLocation=Above&TextAlignment=Center&TextColor=Navy&FontSizeMode=Auto&Resolution=200&ResolutionX=200&BackColor=silver&BarColor=Orange&BorderColor=Blue&format=jpeg" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>"
Panjaluk URL
https://api.aspose.cloud/v3.0/barcode/MySample.jpeg/generate?Type=Code39Standard&Text=BarCode%20processing&TextLocation=Above&TextAlignment=Center&TextColor=Navy&FontSizeMode=Auto&Resolution=200&ResolutionX=200&BackColor=silver&BarColor=Orange&BorderColor=Blue&format=jpeg
Jawa
ApiClient client = new ApiClient(
"App SID from https://dashboard.aspose.cloud/#/apps",
"App Key from https://dashboard.aspose.cloud/#/apps");
com.aspose.barcode.cloud.api.BarcodeApi api = new com.aspose.barcode.cloud.api.BarcodeApi(client);
String name = "MySample.jpeg";
String type = com.aspose.barcode.cloud.model.EncodeBarcodeType.CODE39STANDARD.getValue();
String text = "Barcode processing API"; // String | Text to encode.
String twoDDisplayText = null;
String textLocation = com.aspose.barcode.cloud.model.CodeLocation.ABOVE.getValue();
String textAlignment = com.aspose.barcode.cloud.model.TextAlignment.CENTER.getValue();
String textColor = "Navy";
String fontSizeMode = com.aspose.barcode.cloud.model.FontMode.AUTO.getValue();
int resolution = 200;
double resolutionX = 200;
double resolutionY = 200;
String barColor = "Orange";
String format = "JPEG";
try {
com.aspose.barcode.cloud.model.ResultImageInfo result = api.putBarcodeGenerateFile(
name,
type,
text,
twoDDisplayText,
textLocation,
textAlignment,
textColor,
fontSizeMode,
(double) resolution,
resolutionX,
resolutionY,
null,
null,
null,
null,
null,
null,
null,
null,
"Silver",
barColor,
"Blue",
null,
null,
true,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
format);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BarcodeApi#PutBarcodeGenerateFile");
e.printStackTrace();
}
Barcode Reader Online
Cloud API uga bisa ngenali informasi saka barcode sing ana. Sampeyan entuk pilihan kanggo nemtokake rincian jinis Barcode kanggo njupuk cepet utawa supaya API nemtokake jinis kanthi otomatis. Sampeyan uga bisa nemtokake rincian ChecksumValidation, DetectEncoding, utawa supaya API nemtokake dheweke sajrone runtime.
nggulung
curl -X POST "https://api.aspose.cloud/v3.0/barcode/recognize?Type=all&DetectEncoding=true" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>" \
-H "Content-Type: multipart/form-data" \
-H "x-aspose-client: Containerize.Swagger" -d {"image":{}}
Panjaluk URL
https://api.aspose.cloud/v3.0/barcode/recognize?Type=all&DetectEncoding=true
Jawa
// Kanggo conto lengkap lan file data, bukak https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-java/
String type = null;
String checksumValidation = ChecksumValidation.OFF.toString();
Boolean detectEncoding = null;
String preset = PresetType.HIGHPERFORMANCE.toString();
Integer rectX = null;
Integer rectY = null;
Integer rectWidth = null;
Integer rectHeight = null;
Boolean stripFNC = null;
Integer timeout = null;
Integer medianSmoothingWindowSize = null;
Boolean allowMedianSmoothing = null;
Boolean allowComplexBackground = null;
Boolean allowDatamatrixIndustrialBarcodes = null;
Boolean allowDecreasedImage = null;
Boolean allowDetectScanGap = null;
Boolean allowIncorrectBarcodes = null;
Boolean allowInvertImage = null;
Boolean allowMicroWhiteSpotsRemoving = null;
Boolean allowOneDFastBarcodesDetector = null;
Boolean allowOneDWipedBarsRestoration = null;
Boolean allowQRMicroQrRestoration = null;
Boolean allowRegularImage = null;
Boolean allowSaltAndPepperFiltering = null;
Boolean allowWhiteSpotsRemoving = null;
Double regionLikelihoodThresholdPercent = null;
List<Integer> scanWindowSizes = null;
Double similarity = null;
Boolean skipDiagonalSearch = null;
String australianPostEncodingTable = null;
String rectangleRegion = null;
String url = null;
Path currentRelativePath = Paths.get("");
String currentPath = currentRelativePath.toAbsolutePath().toString();
Path filePath = Paths.get(currentPath, "data", "sample.png");
File image = new File(String.valueOf(filePath));
BarcodeResponseList response =
api.postBarcodeRecognizeFromUrlOrContent(
type,checksumValidation,detectEncoding,preset,rectX,rectY,rectWidth,rectHeight,
stripFNC,timeout,medianSmoothingWindowSize,allowMedianSmoothing,allowComplexBackground,
allowDatamatrixIndustrialBarcodes,allowDecreasedImage,allowDetectScanGap,
allowIncorrectBarcodes,allowInvertImage,allowMicroWhiteSpotsRemoving,allowOneDFastBarcodesDetector,
allowOneDWipedBarsRestoration,allowQRMicroQrRestoration,allowRegularImage,allowSaltAndPepperFiltering,
allowWhiteSpotsRemoving,regionLikelihoodThresholdPercent,scanWindowSizes,similarity,skipDiagonalSearch,
australianPostEncodingTable,rectangleRegion,url,image);
assertNotNull(response);
assertFalse(response.getBarcodes().isEmpty());
BarcodeResponse barcode = response.getBarcodes().get(0);
assertEquals(DecodeBarcodeType.CODE11.getValue(), barcode.getType());
assertEquals("1234567812", barcode.getBarcodeValue());
Yen sampeyan mbukak kode ing ndhuwur ing gambar ndhuwur-ditemtokake, awak Response bakal nerjemahake output minangka
Badan tanggapan
{ "barcodes": [ { "barcodeValue": "12345678", "type": "Code39Standard", "region": [ { "x": **28**, "y": **3** }, { "x": **222**, "y": **3** }, { "x": **222**, "y": **74** }, { "x": **28**, "y": **74** } ], "checksum": "" } ] }
Kesimpulan
Ing artikel iki, kita wis sinau babagan cara ngembangake Aplikasi scanner Barcode nggunakake Java REST API. Kajaba iku, API uga ngidini sampeyan ngetrapake maca kode QR saka file gambar. Saliyane nggunakake Java SDK, kita uga entuk pilihan kanggo mindhai barcode kanthi online nggunakake perintah cURL. Ora ana download utawa instalasi piranti lunak tambahan sing dibutuhake. Yen sampeyan nemoni masalah nalika nggunakake API, hubungi kita liwat Forum dhukungan produk gratis.
Artikel sing gegandhengan
Disaranake uga ngunjungi tautan ing ngisor iki kanggo sinau luwih lengkap babagan: