Yadda ake haɓaka na’urar daukar hotan takardu ta Barcode ta amfani da Java SDK. Aiwatar da damar duba QR a cikin Yanar Gizonku, Wayar hannu da Aikace-aikacen Desktop.

Barcode scanner

Duba barcode online | Na’urar daukar hotan takardu ta QR code

A cikin wannan labarin, za mu tattauna cikakkun bayanai game da yadda ake haɓaka na’urar daukar hotan takardu da na’urar daukar hotan takardu ta QR ta amfani da Java REST API. Mun fahimci cewa a cikin saurin tattalin arziƙin yau, Barcodes sune mahimmanci kuma ingantaccen bayani ga masu siyarwa da yan kasuwa don adana bayanan samfur. A cikin shekaru da yawa, sun tabbatar da cewa sun zama zaɓi mai mahimmanci kuma mai dacewa ga kasuwanci. Sun inganta inganci sosai kuma sun rage sama da ƙasa. Barcodes duka biyu masu tsada ne kuma abin dogaro. Daga cikin fa’idodin amfani da BarCode, ƙayyadaddun ƙasa akwai ƙarin fa’idodin amfani da su

  • Barcodes suna kawar da yiwuwar kuskuren ɗan adam
  • Yin amfani da tsarin barcode yana rage lokacin horar da ma’aikata
  • Barcodes suna da matuƙar dacewa kuma ana iya amfani da su don kowane nau’in tattara bayanai masu mahimmanci
  • Suna taimaka madaidaicin sarrafa kaya, don haka sarrafa kayan ƙira yana inganta
  • Bugu da ƙari, Barcodes suna samar da mafi kyawun bayanai watau lambar lamba ɗaya na iya ba da cikakkun bayanai na kaya da farashi

Dangane da duk irin waɗannan fasalulluka, Aspose.BarCode Cloud Java SDK yana ba masu haɓaka Java damar ƙirƙira tare da bincika Barcode akan layi ta amfani da yaren Java. Kama da sauran APIs ɗinmu na Cloud, Aspose.BarCode Cloud Java SDK yana buƙatar ka yi rajistar asusu a Cloud Dashboard. Idan ka riga ka yi rajista, za ka iya ci gaba da amfani da shi. Da zarar kun shirya asusunku, kuna da kyau ku yi amfani da Ayyukan Cloud ta AppKey da AppSID.

Kuna iya yin la’akari da amfani da Aspose Cloud ajiya ko, yi amfani da kowane sabis na ma’ajiyar girgije na ɓangare na uku don ajiyar fayil da dawo da su.

Taimakon Alamun Barcode

SDK tana goyan bayan alamomin Barcode da yawa (fiye da 60) kamar EAN, UPC, Codabar, PDF417, QR, MicroQR, Postnet, Planet, RM4SCC, da sauransu. Hakanan kuna samun zaɓi don loda bayanan BarCode da ke akwai kuma adana fitarwa cikin mashahurin hoto. Formats, kamar JPEG, PNG, GIF, BMP, TIFF, EMF, [WMF] 9], SVG, EXIF, da ICON. Don cikakken jerin alamun goyan bayan, da fatan za a ziyarci Aspose.BarCode Cloud Java SDK.

Ƙirƙirar Barcode

SDK yana ba ku ƙirƙira Linear, 2D, da hotunan barcode na gidan waya a cikin ɗimbin tsari. Kuna iya ƙididdige sifofin hoton barcode kamar faɗin hoto, tsayi, salon iyaka, da tsarin hoton fitarwa. Hakanan kuna iya ƙididdige nau’in lambar lamba da halayen rubutu kamar wurin rubutu da salon rubutu gwargwadon buƙatun ku. Hakanan yana ba da damar saita tsayin sanduna & juya hotunan barcode a kusurwa.

Misali mai zuwa yana nuna matakan ƙirƙirar Code39Standard Barcode, wanda aka sanya akan jeri na Babban-Cibiyar shafin. An ƙayyadadden launi na rubutu azaman Navy, Horizontal, and Vertical resolution an ƙayyade shi azaman 200. An ƙayyade BarColor azaman Orange, an saita launi na baya azaman azurfa kuma tsarin fitarwa shine tsarin JPEG.

Kafin mu ci gaba, muna ba ku shawarar ku ziyarci hanyar haɗin yanar gizon kamar yadda alamar JWT ta zama dole yayin shiga API ta amfani da umarnin cURL.

CURL

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>"

Neman 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

Java

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();
}
Na'urar daukar hotan takardu ta kan layi

Hoto 1: - Sakamakon BarCode preview.

Barcode Reader Online

Binciken QR

Hoto 2: Na’urar daukar hotan takardu ta QR

API ɗin Cloud kuma yana da ikon gane bayanai daga lambobin barcode ɗin da ke akwai. Kuna samun zaɓi don saka bayanan nau’in Barcode don maidowa da sauri ko barin API ta ƙayyade nau’in ta atomatik. Hakanan kuna iya ƙididdige bayanan ChecksumValidation, DetectEncoding, ko barin API ta tantance su akan lokacin aiki.

CURL

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":{}}

Neman URL

https://api.aspose.cloud/v3.0/barcode/recognize?Type=all&DetectEncoding=true

Java

// Don cikakkun misalai da fayilolin bayanai, da fatan za a je zuwa 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());
2d barcode

Hoto 3:- 2D samfoti na lamba.

Idan kun gudanar da lambar da ke sama akan hoton da aka ƙayyade na sama, ƙungiyar amsawa za ta fitar da fitarwa azaman

Jikin amsawa

{  "barcodes":  [  {  "barcodeValue":  "12345678",  "type":  "Code39Standard",  "region":  [  {  "x":  **28**,  "y":  **3**  },  {  "x":  **222**,  "y":  **3**  },  {  "x":  **222**,  "y":  **74**  },  {  "x":  **28**,  "y":  **74**  }  ],  "checksum":  ""  }  ]  }

Kammalawa

A cikin wannan labarin, mun koyi matakai kan yadda ake haɓaka na’urar daukar hotan takardu ta Barcode ta amfani da Java REST API. Hakazalika, API ɗin kuma yana ba ku damar aiwatar da mai karanta lambar QR daga fayil ɗin hoto. Baya ga amfani da Java SDK, muna kuma samun zaɓi don bincika lambar lamba akan layi ta amfani da umarnin cURL. Babu ƙarin zazzagewar software ko shigarwa da ake buƙata. Idan kun ci karo da kowace matsala yayin amfani da API, da fatan za ku ji daɗin tuntuɓar mu ta [ dandalin tallafin samfur kyauta 14.

Labarai masu alaka

Muna kuma ba da shawarar ziyartar hanyoyin haɗin yanar gizo masu zuwa don ƙarin koyo game da: