Not able to get Bar Code value

Hi Team,
we get below message. We need to sure is tool able to ready proper bar code. Attached file which we fetch bar code.
DocScanner 2 Nov 2021 09.34.pdf (601.2 KB)

41111*Recognized by Aspose Barcode Reader evaluation version. Only Code39Standard can be recognized without restrictions. Please buy license to use Aspose Barcode Reader without watermarks.


You need to use/have valid license and set it in code (before using Aspose.BarCode APIs) to read/write all barcodes which Aspose.BarCode supports. You may even apply for 30 days temporary license here to work with the API without any restrictions.

The Aspose.Barcode cannot read this code and I don’t think that it is possible. This could be Code39 ( some barcode parts look like this format ) but most of bars is glued together and the barcode is unreadable.

barcode.png (66.4 KB)

Hi Team,
we Incase image quality but still system not able to ready Bar Code.

DocScanner 8 Nov 2021 10.45.pdf (1.2 MB)

The quality is still extremely low. We could add the investigation task but ETA can forever.

lowq.png (84.3 KB)


I did test using your PDF file and found Aspose.BarCode can read two of the barcodes which has better quality. The barcodes with low quality cannot be retrieved as @alexander.gavriluk told you.

Hi Team,

I have licensed version of Aspose.Wrod and Aspose.PDF. Below my requirement.

  1. We create PDF with Aspose.Wrods
  2. We Create Bar Code and Append in PDF with Aspose.PDF
  3. User Scan that file and sign and create new PDF
  4. Now we validate user upload same scan copy to match Bar Code.
    Below code we used to create Bar code

Code39 code = new Code39(Guid.NewGuid().ToString().ToUpper());
byteArrayBarcode = code.Paint();
System.IO.MemoryStream ms = new System.IO.MemoryStream(byteArrayBarcode);
ImageStamp img = new ImageStamp(ms);
img.HorizontalAlignment = HorizontalAlignment.Left;
img.VerticalAlignment = VerticalAlignment.Bottom;
img.LeftMargin = 70;
img.BottomMargin = 8;
img.Background = true;
img.XIndent = 200;
img.YIndent = 150;
img.Height = 30;
img.Width = 260;

Please help me to active this. Guide me if we need to do created Bar code differently.

Vipin Paliwal

  1. What the namespace does the Code39 class have?

  2. With BarcodeGenerator you can increase barcode resolution to 300 or 600 and fit it to pdf image

    BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.Code39Extended, “123456”);
    //300 dpi
    gen.Parameters.Resolution = 300;
    MemoryStream ms = new MemoryStream();
    gen.Save(ms, BarCodeImageFormat.Png);
    ms.Position = 0;

I think, this is a problem. You can solve this by:

  1. Increasing barcode size.
  2. Replacing Code39 with some 2D barcodes like pdf417 or QR. Create 2D barcodes with large amount of correction codewords:
    Enum Pdf417ErrorLevel | Aspose.BarCode for .NET API Reference

Hi Team,

We update our code based on your recommendation. But still we not able to read barcode. Please attached both file Orginal PDF and Scan PDF. Please help us to achive this.

BarcodeGenerated.pdf (2.7 MB)
DocScanner 9 Nov 2021 12.28.pdf (593.8 KB)

As you see, printing and scanning makes text and barcode unreadable in any way (problem.png ) and I don’t think that any algorithm can help with this.

problem.png (9.1 KB)

You can:

  1. Increase barcode size or printing and scanning resolution.
  2. Use pdf417 barcode with increased image size, pdf417 can encode more information in on the same place.

You need to make bars of the barcode to be visually split one from other. There is no other solution exists.

I printed the page, scanned with 300 dpi and the image is recognizable. You need at least this quality to recognize the image. The Code 39 for so long data is not the best choice.

recognized.jpg (865.5 KB)