String reference not set to an instance of a String.\r\nParameter name: s


#1

Good morning.

I am trying out ReadBarcodeFromLocalFile, but I am getting this error: String reference not set to an instance of a String.\r\nParameter name: s

I am testing it through the code example I have downloaded from the Aspose website. I have created a test barcode using the following settings/properties:

        String name = "sample-barcode";
        String text = "Aspose.BarCode";
        String type = "QR";
        String format = "PNG";
        String enableChecksum = "NO";

Now I am trying to read it from my local disc using basically the default settings that was in the sample project I have downloaded.

        String name = "sample-barcode.PNG";
        String type = "QR";
        String checksumValidation = "NO";
        bool stripFnc = false;
        int rotationAngle = 0;
        String url = null;

I have tried setting the url variable to an empty string, but it also doesn’t work.

Could you please assist me with letting me know how I am supposed to do this? Could you also please explain wha the url variable is for and what I need to populate it with?

Regards,
Jolandie


#2

Sorry, I forgot to mention that the error is happening when the PostBarcodeRecognizeFromUrlorContent operation is called as per sample code below:

BarcodeResponseList apiResponse = barcodeApi.PostBarcodeRecognizeFromUrlorContent(type, checksumValidation, stripFnc, rotationAngle, url, file);


#3

@jolandieg

Thank you for contacting Aspose Support.

We are testing the API and will update you shortly.


#4

@jolandieg

We have identified a bug in the Aspose.Barcode for Cloud SDK and we are fixing it. We will update you here as soon as we publish the new NuGet package (with the fixed bug).


#5

Thank you. Waiting for your reply.


#6

We have fixed the bug in the SDK, now updating NuGet package.


#7

@jolandieg

Updated NuGet package has been published. Please download Aspose.BarCode-Cloud v1.1.0 from NuGet and let us know your feedback.


#8

Thank you very much. I am now able to read the barcode from my local folder.

I am still trying to figure out exactly how to use the api. Would you please send me a bit more information regarding the parameters used when reading and generating a barcode. I have included a couple of the variables passed to the api below, with some questions in brackets next to the variable declarations.

         SAVE TO LOCAL DISC:

        // Set Text to encode inside barcode
        String text = "Aspose.BarCode"; (What exactly do I need to populate this variable with?)
         

        // Set Barcode Symbology
        String type = "QR"; (What is the value for other types?)
        
        // Set Barcode Image Format
        String format = "PNG"; (Can I use any image format here?)

        // Sets if checksum will be added to barcode image.
        String enableChecksum = "NO"; (Could you please explain what is this used for?)

        READ FROM LOCAL DISK:

        // Set if FNC symbol stripping should be performed
        bool stripFnc = false; (Could you please explain what is this used for?)

        // Set recognition of rotated barcode
        int rotationAngle = 0; (Could you please explain what is this used for?)

        // Set the image file url 
        String url = null; (Could you please explain what is this used for?)

Regards,
Jolandie


#9

@jolandieg

Please check Aspose.Barcode for Cloud Docs, it will answer most of your questions.

Please do let me know if there is still have any ambiguity.


#10

Thanks for pointing me to the documentation. I had a look at it, but I still have a few questions.

SAVE TO LOCAL DISC:

    // Set Barcode Symbology
    String type = "QR"; (According to the documentation there are many different kinds of types I can use. How should I go about choosing the correct type? I want to implement a barcode system in an Engineering business where they need to keep track of engine parts bought and issued.)

    // Sets if checksum will be added to barcode image.
    String enableChecksum = "NO"; (The documentation does not give a lot of information regarding this. Should I be passing this in as "YES", depending on the barcode type I am going to choose?)

    READ FROM LOCAL DISK:

    // Set if FNC symbol stripping should be performed
    bool stripFnc = false; (Could you please explain what is this used for?)

#11

@jolandieg

String enableChecksum = “NO”; (The documentation does not give a lot of information regarding this. Should I be passing this in as “YES”, depending on the barcode type I am going to choose?)

EnableChecksum enumeration docs may help you in understanding this property.

bool stripFnc = false; (Could you please explain what is this used for?)

StripFNC strips FNC1, FNC2, FNC3 characters from codetext. Default value is false.

Aspose.Barcode REST APIs are based on Aspose.Barcode native APIs. Please check Aspose.Barcode .NET APIs documentation, it may help you to develop a deeper understanding of the product.