Free Support Forum -

Some QR code generation issues and questions


I have some issues related to some QR code generation and questions.

1. QR code generation speed

I have tried to make QR code images from a binary file.

Therefore, I made several large QR code images with set CodeText to the nearly maximum capacity of QR code.

But, the speed of barcode image generation was very slow;

It was almost 2 minutes and 6 seconds in generating 11 large QR code images.

I tried with J4Ls Barcodes for .NET with almost same conditions;

It was only 18 seconds in generating same QR code images.

I think that your product is superior to J4Ls because J4Ls is lacked in many features and stabilities but the difference between Asposes and J4Ls are too much.

I hope that the performance will be improved at future release.

2. Some questions about QR code

I know that the capacity of QR code is 4296 at alphanumeric mode and 2953 at binary mode.

But, I did not find the property to set the mode of QR code.

And, I have a question about mode.

Are only alphabets and numbers permitted at alphanumeric mode?

If I set code text to a string containing / or ?, must it be binary mode?

I think that is right because the max capacity seems to be accorded with 2953 when I set code text to the string containing / or ?.

What I know really is how long I can insert at QR code image with Aspose Barcode.NET and how I set CodeText to byte array directly.

3. The issue about blank barcode image is generated when code text is set to over maximum capacity.

When I set code text to a string of 3000 length (i.e. over 2953), generated barcode image was blank and only became a white rectangle. The library did not alert any error.

If you could take a few minutes to answer my questions, I would really appreciate it.

Thank you in advance for your help and apologize for my short English skill.

Best regards,

S. H. Park

Thanks for considering Aspose.

Our technical supporting engineer is working on your questions. We will get back to you shortly.

Best regards.

Hi dark,

Thanks for your post!

Aspose.BarCode will select the appropriate charset mode by examining the given codetext automatically. Therefore the BarCodeBuilder does not have a property to set the mode.

According to the specification of QR barcode, the max capacity of codetext could be:

  • Numeric(0-9): 7089
  • AlphaNumber: 4296
  • 8-bit Byte(0x00-0xFF): 2953
Please note that these max capacities are calculated in L error correction level.

For the AlphaNumber mode, the codetext should be:0-9,A-Z and space $ % * + - . / : ; So it will be 8-bit Byte mode if the codetext contains '?' but AlphaNumber mode if it contains '/';

Hope these will help.


Thank you.

Bye the way, I have another question.

I know that I can set a string variable to CodeText property.

But, how can I set byte array to 2D barcode directly?

I know that many 2D barcode component can permit to assign byte array.

Best regards.

S. H. Park

Hi Park,

Thanks for your post!

In fact the 2D BarCode is encoding characters rather than bytes, so if bytes are specified, the components will covert it to char array usually. But as you know, there are many way to do the conversion and cause difference result. For example, the results of System.Text.ASCIIEncoding.GetString(thebytes) and System.Text.UTF8.GetString(thebytes) are difference. So in Aspose.BarCode, we just exposed a string type CodeText property and let the users to choose a most appropriate conversion to their application.

By the way, if you are encoding bytes that represents some binary data such as an image, I suggest you do the conversion as the below sample:

byte[] thebytes = {0x61,0x62,0x63,0x54,0xe7};
StringBuilder stringBuilder= new StringBuilder();
for (int i = 0; i < thebytes.Length; i++)



barcodeBuilder.CodeText = stringBuilder.ToString();

After this conversion, the chars array contains in the
CodeText will be(in int value): {0x0061,0x0062,0x0063,0x0054,0x00e7}, that is
same int values as the byte array. But if you use the GetString function in
Text.Encoding, you may get chars with difference int values.