Flattened Code39Extended Barcode .. What went wrong?


#1
		I am building a Barcode image with the barcode builder class 

and add to the pdf document

                    BarCodeBuilder bc = new BarCodeBuilder();
		bc.CodeText = "Some Text" 
                    bc.EncodeType = EncodeTypes.Code39Standard;
	        bc.CodeLocation = CodeLocation.None;

		MemoryStream imgStream = new MemoryStream();
		bc.Save(imgStream, BarCodeImageFormat.Png);
                   page.AddImage(imgStream, new Aspose.Pdf.Rectangle(280, 0, 340, 50));

This works well if the EncodeTypes is Datamatrix.
However, on Code39Standard…
The bar code I got is flat as a pan cake…

What am I doing wrong ? Thanks …


#2

@nick1234,

You may use the code snippet given below to generate the Barcode.

BarCodeGenerator barCodeGenerator = new BarCodeGenerator(EncodeTypes.Code39Standard);
barCodeGenerator.CodeText = "Some Text";
barCodeGenerator.CodeTextStyle.Location = CodeLocation.None;

barCodeGenerator.Save("SomeText.png", BarCodeImageFormat.Png);

We have attached the generated Barcode below.
SomeText.png (126 Bytes)
Please use the latest version of Aspose.Email for .NET API for testing.
We hope that this answered your question. Please feel free to contact us if additional information is required.


#3

How do I suppress the text below the barcode ? test.png (575 Bytes)

Thanks


#4

Also… Although I can scan the barcode on my computer screen, once printed on paper… its very tiny and not scannable… How do I adjust the height and width ?


#5

@nick1234,

You may hide the CodeText using the code snippet given below.

barCodeGenerator.CodeTextStyle.Location = CodeLocation.None;

To set the size and resolution of the generated barcode, please see the examples given on links given below.

Generating Barcode with Restricted Barcode Size
Units based Barcode Generation