Conas aip scanóir Barcode a fhorbairt ag baint úsáide as Java SDK. Cuir cumais scanadh QR i bhfeidhm i d’Fheidhmchláir Ghréasáin, Soghluaiste agus Deisce.

Scanóir barcode

Scan barrachóid ar líne | Scanóir cód qr agat

San Airteagal seo, táimid chun na sonraí a phlé maidir le conas scanóir Barcode agus aip scanóir cód QR a fhorbairt ag baint úsáide as Java REST API. Tuigimid i ngeilleagair luas tapa an lae inniu, gur réiteach riachtanach agus inmharthana iad Barrachóid do dhíoltóirí agus do cheannaithe chun sonraí táirgí a stóráil. Thar na blianta, tá siad cruthaithe a bheith ina rogha luachmhar agus inmharthana do ghnólachtaí. Tá éifeachtacht feabhsaithe go mór acu agus laghdaigh siad forchostais. Tá na barrachóid costas-éifeachtach agus iontaofa araon. I measc na mbuntáistí eile a bhaineann le húsáid BarCode, sonraítear thíos roinnt buntáistí eile as iad a úsáid

  • Cuireann barrachóid deireadh leis an bhféidearthacht earráid dhaonna
  • Laghdaíonn úsáid córas barrachóid am oiliúna fostaithe
  • Tá barrachóid thar a bheith ildánach agus is féidir iad a úsáid le haghaidh aon chineál sonraí riachtanacha a bhailiú
  • Cumasaíonn siad rialú fardail beacht, agus mar sin feabhsaítear rialú Fardail
  • Ina theannta sin, cuireann na Barrachóid sonraí níos fearr ar fáil .i. féadfaidh barrachód amháin sonraí fardail agus praghsála a sholáthar

Baineann Aspose.BarCode Cloud Java SDK ar chumas fhorbróirí Java Barcode a chruthú chomh maith le scanadh ar líne ag baint úsáide as teanga Java. Cosúil lenár Cloud APIs eile, éilíonn Aspose.BarCode Cloud Java SDK go gcláróidh tú cuntas ag Cloud Dashboard. Má tá cuntas cláraithe agat cheana féin, is féidir leat leanúint ar aghaidh á úsáid. Nuair a bheidh do chuntas réidh agat, tá tú go maith chun na Seirbhísí Néal a úsáid trí AppKey agus AppSID.

Is féidir leat smaoineamh ar úsáid stórála Aspose Cloud nó, aon seirbhísí stórála néil tríú páirtí a úsáid le haghaidh stóráil comhad agus aisghabháil.

Siombailí Barcode Tacaithe

Tacaíonn an SDK le go leor siombailí Barcode (níos mó ná 60) mar EAN, UPC, Codabar, PDF417, QR, MicroQR, Postnet, Planet, RM4SCC, etc. Gheobhaidh tú an rogha freisin faisnéis Barcode atá ann cheana féin a luchtú agus an t-aschur a shábháil i íomhá tóir. formáidí, mar JPEG, PNG, GIF, BMP, TIFF, EMF, WMF 9], SVG, EXIF, agus ICON. Le haghaidh liosta iomlán de na siombailí tacaithe, tabhair cuairt le do thoil ar Aspose.BarCode Cloud Java SDK.

Gin Barcode

Cuireann an SDK ar fáil duit íomhánna Líneacha, 2D, agus barrachód poist a chruthú i iliomad formáidí. Is féidir leat tréithe íomhá barrachóid a shonrú amhail leithead íomhá, airde, stíl teorann, agus formáid íomhá aschuir. Is féidir leat freisin an cineál barrachóid agus tréithe téacs ar nós suíomh an téacs agus stíleanna cló de réir do riachtanais iarratais. Soláthraíonn sé freisin na cumais chun airde na mbarraí a shocrú & íomhánna barrachóid a rothlú ar uillinn.

Taispeánann an sampla seo a leanas na céimeanna chun Cód39Standard Barcode a chruthú, a chuirtear ar ailíniú Barr-Ionad an leathanaigh. Tá dath an téacs sonraithe mar Navy, Cothrománach, agus Sonraítear taifeach Ingearach mar 200. Sonraítear an BarColor mar Oráiste, socraítear an dath cúlra mar airgead agus is é an fhormáid aschuir ná formáid JPEG.

Sula ndéanaimid dul ar aghaidh níos faide, molaimid duit cuairt a thabhairt ar an nasc seo a leanas toisc go bhfuil gá le comhartha JWT agus tú ag rochtain ar an API ag baint úsáide as an ordú 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>"

Iarr 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();
}
Scanóir barcode ar líne

Íomhá 1:- Réamhamharc Barcode an Tionchair.

Léitheoir barcode ar líne

Scanadh QR

Íomhá 2: Scanóir cód QR

Tá an Cloud API in ann faisnéis ó bharrachóid atá ann cheana féin a aithint. Gheobhaidh tú an rogha sonraí an chineáil Barcode a shonrú le haghaidh aisghabháil tapa nó ligean don API an cineál a chinneadh go huathoibríoch. Is féidir leat sonraí ChecksumValidation, DetectEncoding, a shonrú freisin nó ligean don API iad a chinneadh thar an am rite.

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

Iarr URL

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

Java

// Le haghaidh samplaí iomlána agus comhaid sonraí, téigh chuig 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 cód barra

Íomhá 3:- Réamhamharc barrachóid 2T.

Má ritheann tú an cód thuas ar an íomhá thuas-shonraithe, déanfaidh an comhlacht Freagartha an t-aschur mar

Comhlacht freagartha

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

Conclúid

San Airteagal seo, tá na céimeanna foghlamtha againn maidir le conas App scanóir Barcode a fhorbairt ag baint úsáide as Java REST API. Ar an gcaoi chéanna, cuireann an API ar do chumas léitheoir cód QR a chur i bhfeidhm ó chomhad íomhá. Seachas an Java SDK a úsáid, faigheann muid rogha freisin barrachód a scanadh ar líne ag baint úsáide as orduithe cURL. Níl gá le bogearraí breise a íoslódáil nó a shuiteáil. I gcás go dtiocfaidh aon fhadhbanna ort agus an API á úsáid agat, ná bíodh drogall ort teagmháil a dhéanamh linn tríd an fóram tacaíochta táirge saor in aisce.

Airteagail Ghaolmhara

Molaimid freisin cuairt a thabhairt ar na naisc seo a leanas chun tuilleadh a fhoghlaim faoi: