We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Mixed case- lowercase- special characters not rendering correctly

With the code identified below, we can reliably create numerical and uppercase only QR codes. If we attempt to encode a mixed case or special character string, the QR code that is created becomes corrupted. In this example, the resulting QR code is attached and the code comes out as s:00H:AT000 instead of "ThisIsATest". What are we missing? We are using version, is an update in order? Let me know.

Sample code:

Dim ActiveBarCode As String = "ThisIsATest"

Dim stream1 As MemoryStream = New MemoryStream

Dim BarCodeLicense As Aspose.BarCode.License = New Aspose.BarCode.License()


Dim BarCode As Aspose.BarCode.BarCodeBuilder

BarCode = New BarCodeBuilder()

BarCode.SymbologyType = Symbology.QR

BarCode.AspectRatio = 1

BarCode.BorderVisible = False

BarCode.xDimension = 1

BarCode.yDimension = 1

BarCode.Resolution = New Aspose.BarCode.Resolution(300, 300, ResolutionMode.Graphics)

BarCode.CodeLocation = CodeLocation.Below

BarCode.EnableChecksum = True

BarCode.Margins.Top = 0

BarCode.Margins.Right = 0

BarCode.Margins.Bottom = 0

BarCode.Margins.Left = 0

BarCode.ImageQuality = ImageQualityMode.Default

BarCode.PrinterName = "Example"

BarCode.QRErrorLevel = QRErrorLevel.LevelH

BarCode.CodeText = ActiveBarCode

BarCode.Save(stream1, System.Drawing.Imaging.ImageFormat.Gif)



context.Response.Buffer = False

context.Response.BufferOutput = True

context.Response.ContentType = "image/gif"

stream1.Position = 0

Dim bytesRead As Integer = stream1.Read(imgBuffer, 0, 256)

While bytesRead > 0

context.Response.OutputStream.Write(imgBuffer, 0, bytesRead)

bytesRead = stream1.Read(imgBuffer, 0, 256)

End While

imgBuffer = Nothing



The recognition with mixed case and special characters is working fine with the latest version v3.6. I tested by setting the codetext to “ThisIsATest(){}|/=± !@#$%^&*” which was recognized correctly.

You may download the latest version from http://www.aspose.com/community/files/51/.net-components/aspose.barcode-for-.net/default.aspx.

The sample project (console application similar to the code above) is also attached.

However, I found some problem if I set the right margin to 0, it throws an exception while reading. It works correctly, if the right margin is set to 1. I have logged this issue in our bug tracking system (ID: 18588). We will inform you when it gets resolved. Sorry for the inconvenience.