I'm using iTextSharp to create Code 39. How can I change the size of the code? I can change only the height of the code (via BarHeight property) but not the width.
My code:
Barcode39 code = new Barcode39();
code.Code = content;
code.Baseline = 20; // Doesn't affect rendering.
code.Size = 20; // Doesn't affect rendering.
code.BarHeight = 60; // DOES affect rendering.
Image img = code.CreateDrawingImage(Color.Black, Color.White);
I could resize the image, but I fear that the resolution of the image would suffer.
I think the only way that you're going to be able to resize it is to scale the resulting image. The image is a vector image so you don't have to worry about quality although you should make sure to read up on the width rules at various printed sizes. Scaling the image will unfortunately also scale the text portion so you might have to set bc39.AltText
to an empty string and manually draw the text on.