How to Read Data Matrix and Vin barocde in .NET using Aspose.BarCode REST API

I am evaluating Aspose Cloud Barcode reader using the .Net API and am getting a JasonSerializationException, Error converting value “” to type ‘Aspose.Cloud.BarCodeType’. Line 1, position 143.





Here is my code:

Dim barCodeService As New Aspose.Cloud.BarCodeService(appSid, appKey)





Dim storageService As New Aspose.Cloud.StorageService(appSid, appKey)

storageService.File.UploadFile(FileNameandPath, “Barcode/” + FileName)





Dim barCodeReader As New Aspose.Cloud.BarCodeReader()



Dim result As BarcodeResponse = barCodeService.RecognizeBarCodeFromFileOnServer(FileName, barCodeReader, Aspose.Cloud.BarCodeType.DataMatrix, “Barcode”)







The above code works great if I set the barcodeType to Code39Standard. Looks like a bug.



Also, is there a way to search for all barcode types? The documentation for the API is almost non-existent and I cannot find anywhere that shows me the different overloads for the RecognizeBarCodeFromFileOnServer method.



Charles

Hi Charles,


Thank you for contacting support. We tested a DataMatrix barcode image against your sample code and the latest Aspose for Cloud SDK. We can read DataMatrix code successfully. Please download the latest Aspose for Cloud SDK from there and let us know how it goes on your side.

We hope, this helps. Please feel free to reply us in case of any confusion or questions.

@chart145

As an update, please note recently we have released the V3 API Version of Aspose.BarCode Cloud API. In this API version, we have introduced its own storage API methods. Now you do not need to reference Aspose.Storage Cloud API for the purpose. Please find the sample code for reference and if you have any questions or concerns then please feel free to contact us .

Dim localfile As String = "C:/Temp/datamatrix-code-multiple-matrix.png"
Dim remotefileName As String = "datamatrix-code-multiple-matrix.png"
Dim remoteFolder As String = "Temp"
Dim presetType As String = "HighPerformance"
// upload image file to cloud storage
barcodefileApi.UploadFile(New Aspose.BarCode.Cloud.Sdk.Model.Requests.UploadFileRequest(remoteFolder & "/" & remotefileName, System.IO.File.OpenRead(localfile)))

//Read the barcode
Dim request = New GetBarcodeRecognizeRequest(remotefileName, folder:=remoteFolder, preset:=presetType)
Dim response As BarcodeResponseList = barcodeApi.GetBarcodeRecognize(request)