I am trying to place the barcode Caption text at the top of the barcode image which does get displayed but the issue is the caption at the top is not displaying the text in a single line in a readable font size.
Below is the code snippet:-
Caption captionAbove = new Caption
{
Text = string.Format("{0}-{1}-{2}-{3}-{4}-{5}", “ISBN”, barCodeValue.Substring(0,3), barCodeValue.Substring(3, 1), barCodeValue.Substring(4,7),
barCodeValue.Substring(11, 1), barCodeValue.Substring(12, 1)),
TextAlign = StringAlignment.Far,
Visible = true,
Font = new System.Drawing.Font(“Arial”, 6f),
ForeColor = System.Drawing.Color.Black,
Space = 1f
};
var barColor = System.Drawing.Color.FromArgb(0, 0, 0);
using (var bb = new BarCodeBuilder(barCodeValue))
{
bb.AutoSize = true;
bb.GraphicsUnit = GraphicsUnit.Millimeter;
bb.CodeTextColor = barColor;
bb.BarHeight = 40f;
bb.xDimension = 0.30f;
bb.Margins = new MarginsF(1.5f, 1.5f, 1f, 0.5f);
bb.CaptionAbove = captionAbove;
bb.CodeLocation = CodeLocation.None;
var curResolution = new Resolution(300f, 300f, ResolutionMode.Graphics);
var curFont = new System.Drawing.Font("Arial", 9f);
bb.ImageQuality = ImageQualityMode.AntiAlias;
bb.Resolution = curResolution;
bb.CodeTextFont = curFont;
bb.SymbologyType = Symbology.EAN13;
bb.RotationAngleF = SetRotation(rotation);
tempBarCodeImageFile = Path.Combine(TempFolderRoot, (Guid.NewGuid() + ".jpg"));
bb.Save(tempBarCodeImageFile, System.Drawing.Imaging.ImageFormat.Jpeg);
}
Here is the requirement [Image at the top is how the caption should be displayed]
image.jpg (7.5 KB)
Please let me know if there is any setting(s) to change to get the desired result.