Aspose barcode volume


#1

I have created a barcode on my pdf document using aspose. Basically we create the barcode in memory and write the barcode out to the document using Active PDF( ie. another third party piece of software) - we have put the code into operation on our live server see below

lbc.CodeText = strAccountNo & "-" & strArrResults(5) & "-" & strArrResults(14)
lbc.BarHeight = 18.0F
lbc.ImageQuality = Aspose.BarCode.ImageQualityMode.AntiAlias
lbc.BorderWidth = 0
lbc.ShowBorder = False
lbc.SymbologyType = Aspose.BarCode.Symbology.Code39Extended
lbc.BitmapImage.Save(mStream, System.Drawing.Imaging.ImageFormat.Jpeg)
oPDFBarcode.ImageByteArray = mStream.GetBuffer
Call oPDFBarcode.SetFormFieldData("image", "MEMORY", -995)
mStream.Close()
mStream = Nothing
lbc.Dispose()
lbc = Nothing

Unfortunately we appear to be getting problems and our code stops working when our volumes increase. i was wondering if you could help me or if you have any experience of this problem.

i dont know if this is connected but i also get the error

Exception A generic error occurred in GDI+.

thanks

CG


#2

Hi, CG,

It's our pleasure to provide any help.

Could you tell the version of barcode are you using? Your application is a web application or others? And could you post the detail of the exception?

thanks


#3

Hello,

Thank you for considering Aspose.BarCode!

Please download our newest release and try using BarCodeBuilder instead of LinearBarCode.

Dim bb As Aspose.BarCode.BarCodeBuilder
bb.CodeText = strAccountNo & "-" & strArrResults(5) & "-" & strArrResults(14)
bb.BarHeight = 18.0F
bb.ImageQuality = Aspose.BarCode.ImageQualityMode.AntiAlias
bb.BorderWidth = 0
bb.BorderVisible = False
bb.SymbologyType = Aspose.BarCode.Symbology.Code39Extended
bb.BarCodeImage.Save(mStream, System.Drawing.Imaging.ImageFormat.Jpeg)
oPDFBarcode.ImageByteArray = mStream.GetBuffer
Call oPDFBarcode.SetFormFieldData("image", "MEMORY", -995)
mStream.Close()
mStream = Nothing
bb.Dispose()
bb = Nothing

If possible, could you tell us what your CodeText is?

The following link leads to the newest version download:

http://www.aspose.com/Downloads/Aspose.BarCode/1.6.0.0/Default.aspx


#4
The codetext is something like
QG285842:3/G8654231/192.79
Thanks
Colin

#5

Hello,

I'm wondering if I got the right idea, could you tell me more about what "VOLUME" means? Image's size, running time or call frequency? I failed to reproduce that exception. Please give me more info about that exception.

Thank you!


#6
Basically we have a function that can be called multiple times by different clients - our system uses asp.net and calls our function - basically the function uses a tool called active pdf 4.0 to populate the form fields on the pdf. We use ASPOSE to create the barcode in a memory stream and there is an option within Active PDF to write this barcode to the document.. The problem we have is that after a certain amount of volume (ie no. of times a user performs a certain action) hits our system then there is an error. If i comment out the ASPOSE and rerun the the software we do not have the same problem - on our system we can see that the memory on server starts to increase and then goes to the maximum amount. I have ammended my code to the following to use the barcode builder

lbc.CodeText = strAccountNo & "-" & strArrResults(5) & "-" & strArrResults(14)
lbc.BarHeight = 32.0F
lbc.AutoSize = True
lbc.ImageQuality = Aspose.BarCode.ImageQualityMode.AntiAlias
lbc.BorderWidth = 0
lbc.SymbologyType = Aspose.BarCode.Symbology.Code39Extended
lbc.BarCodeImage.Save(mStream, System.Drawing.Imaging.ImageFormat.Jpeg)
oPDFBarcode.ImageByteArray = mStream.GetBuffer
Call oPDFBarcode.SetFormFieldData("image", "MEMORY", -995)
mStream.Flush()
mStream.Close()
mStream = Nothing
lbc.Dispose()
lbc = Nothing
My original code was
lbc.CodeText = strAccountNo & "-" & strArrResults(5) & "-" & strArrResults(14)
lbc.BarHeight = 18.0F
lbc.ImageQuality = Aspose.BarCode.ImageQualityMode.AntiAlias
lbc.BorderWidth = 0
lbc.ShowBorder = False
lbc.SymbologyType = Aspose.BarCode.Symbology.Code39Extended
lbc.BitmapImage.Save(mStream, System.Drawing.Imaging.ImageFormat.Jpeg)
oPDFBarcode.ImageByteArray = mStream.GetBuffer
Call oPDFBarcode.SetFormFieldData("image", "MEMORY", -995)
mStream.Close()
mStream = Nothing
lbc.Dispose()
lbc = Nothing
The problem that i am now having is that the barcode which is produced using the new barcode builder method is not the same as using the linear method. Unfortunately we have setup scanning systems to read this barcode. Can you please tell me how to reproduce the exact same barcode with the new method. It would appear that the new method produces a smaller barcode which our system cannot read - why would the appearance change when the symbology is the same.
Thanks
CG

#7

One more addition:

I think the increasing memory usage could be relative to the image resolution settings. Please try to reduce the resolution for the barcode image rendering and test with your barcode reader.

like:

bb.Resolution = New Resolution (100, 100, ResolutionMode.Customized);

Thanks again.


#8

Hello,

Thank you for considering Aspose.BarCode

First of all, to control barcode image's size: if it's 1D barcode, we could change the xDimension setting.

bb.xDimension = 0.5f

That means the narrowest black bar or space would be 0.5 millimeter.

Second of all, I see you use the default Resolution setting, and LinearBarCode has a default resolution bigger than BarCodeBuilder, then the (DPI) dots per inch is bigger, and the image seems bigger.

BarCodeBuilder's default resolution is common monitor screen resolution, which is 96*96 DPI

I believe if you set:

bb.Resolution = New Resolution(300, 300, ResolutionMode.Customized)
bb.xDimension = 0.3f

than the image will be the same.

Thirdly, symbology only decides barcode image's topology, which is how many black bars and how many white bars. Thus barcode image may not be the same if xDimension or BarHeight is different. In some symbologies, WideNarrowRatio will also play a role too, cos it decides the ratio of wide bars to narrow bars

I hope I helped. Please tell us if this infomation suffices.

Best regards.