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

Free Support Forum - aspose.com

Code 128 barcode detection

Hi,


I wonder if you can assist.

I’m using the Aspose barcode generator to create a document separation page that we use to separate batches of documents (as per attached samples).

Once scanned I use the Aspose barcode reader to detect the separation pages and split the documents into logical batches.

I’m not getting such a great detection rate on the barcodes and documents are subsequently not getting split correctly. Of the attached samples, only 1 is being detected.

Document1.tif (300dpi) - The reader only detects the barcode in this document.
Document2.tif (200dpi) - Cannot detect
Document3.tif (300dpi) - Cannot detect

Do you have any suggestions on what size/type of barcode is best to achieve this?

I’m using the following code to create the barcode;
Dim bb As Aspose.BarCode.BarCodeBuilder = New Aspose.BarCode.BarCodeBuilder

'Set the Code text for the barcode
bb.CodeText = “DOCSEP”

'Set the symbology type to Code39Standard
bb.SymbologyType = Aspose.BarCode.Symbology.Code128

'Set the width of the bars to 1 millimeter
bb.xDimension = 1.0F

bb.CaptionAbove.Text = “Metrofile Document Seperator”
bb.CaptionBelow.Text = bb.CodeText
bb.ImageQuality = 100

'Save the image to your system and set its image format to Jpeg
bb.Save(“C:\barcode.jpg”, System.Drawing.Imaging.ImageFormat.Jpeg)

and the following code to read the scanned page

reader = New BarCodeReader(tempPath & “TEMP.TIF”, BarCodeReadType.Code128)

Try
Do While reader.Read()
If reader.GetCodeText().ToString.ToLower = “DOCSEP” Then
'Do my processing here
End If
Loop
Catch ex As Exception
MsgBox("Err: " & ex.Message, MsgBoxStyle.Critical)
End Try
reader.Close()

Also, on a side note. How do I remove the “ASPOSE” on the top left of the barcode?

Thanks in advance
Wayne

Hi Wayne,


Thank you for your inquiry.

I have tested your provided sample files and I am unable to read the barcode from Document2.tif and Document3.tif. Can you please share the parameters that you have set while creating these two barcode labels.

Also, please mention the version of Aspose.BarCode for .NET that you are using.

Hi,


I’m using Aspose.Barcode 4.2 and Aspose.BarCodeRecognition 4.2.

All the attached barcodes are from the same file, I’ve basically just printed it out and rescanned it at different resolutions.

From my code samples above, I created the “barcode.jpg” and embedded it in a pdf document (attached) that we just print out when we need more document separation pages.

The only thing that I can see with the two that aren’t read is that they are slightly lighter and less defined compared to document1.tif. But if we are going to reproduce the separation page by printing it, this will occur. I do understand that if the barcode isn’t printed correctly (due to low toner etc) we will have recognition issues, but from my experience document2 and document3 should read. Especially because of the size and density that we created it at?

I don’t mind if I need to change my barcode for better recognition, but I would need it to be successfully read at at least 200dpi - 240dpi.

Hope this helps.

Thanks
Wayne


Hi Wayne,


Sorry for not answering your question earlier in my reply. The word “Aspose” is due to the reason that you are using the Aspose.BarCode for .NET in evaluation mode. You can get rid of it by setting the License file in your code.
Please check the detailed article on the subject,
http://www.aspose.com/documentation/.net-components/aspose.barcode-for-.net/licensing.html

Regarding your original question, I am able to read the barcode from your provided PDF file just fine. But I am still unable to read the barcodes from sample files document2.tif and document3.tif. The most probable reason is that after scanning and printing, the images have distorted to an extent where the barcodes are illegible.

I have tried using the Recognition Hints as well. Please check the below link for some related topics.
http://www.aspose.com/documentation/.net-components/aspose.barcode-for-.net/barcode-recognition-advance-features.html

Perfect thanks, I’ll try some of the Recognition Hints provided.


Quick question, you mentioned that you detected the barcode in the PDF document? How did you do that as currently I’m converting all PDF’s back to TIF in order to process the barcodes and this covert takes a little time. Ideally, I would prefer to process the PDF without having the overhead of the convert.

Thanks
Wayne

Hi Wayne,


I have used Aspose.Pdf.Kit for .NET component to extract images from your provided Pdf file and passed that image to Aspose.BarCode for .NET.

Please check the below linked technical article on the subject,
http://www.aspose.com/documentation/.net-components/aspose.pdf.kit-for-.net/extract-image-from-pdf-document.html

Regards,