This project has moved. For the latest updates, please go here.

1D barcode 'content text' cut off

Nov 22, 2013 at 9:18 PM
When composing a 1D barcode the "content text" added to the bottom is getting cut off:

https://www.dropbox.com/s/c17s282951wsg0l/Screenshot%202013-11-22%2016.06.58.png

The outer line is the border of the picture box. The barcode seems to generate the white background.

The code is:
        writer = new BarcodeWriter
        {
            Format = BarcodeFormat.CODE_39,
            Options = new EncodingOptions
            {
                Height = pictureBox2.Height-20,
                Width = pictureBox2.Width,
            }
        };
        result = writer.Write(textBox1.Text.ToUpper());
        pictureBox2.Image = result;
When I make the height smaller it just makes the combined barcode smaller still with the cut off text at the bottom.

Any ideas?

Also would like to know how to use the PureBarcode option correctly. Have tried but can't seem to find the right way to generate the option. Still would prefer the text to print correctly.
Coordinator
Dec 1, 2013 at 7:42 PM
The bitmap renderer uses as the default font Arial with a size of 10.
Do you use another windows font and screen setting like 120dpi?

You can change the font with the following code snippet:
writer = new BarcodeWriter
{
   Format = BarcodeFormat.CODE_39,
   Options = new EncodingOptions
   {
      Height = pictureBox2.Height-20,
      Width = pictureBox2.Width,
   },
   Renderer = new BitmapRenderer
   {
      TextFont = new Font("Arial", 10, FontStyle.Regular)
   }
};
result = writer.Write(textBox1.Text.ToUpper());
pictureBox2.Image = result;
PureBarcode means that it should only generate the bars not the text below the bars.