Good afternoon,
I have purchase Aspose.Total and am trying to use the Aspose.Barcode package to generate a Code39 barcode. My label size is 3" x 2" for a thermolabel printer capable of printing at 300DPI. I am trying to maximize the font size for the top and bottom captions while fitting in the constraints of the label. I am unsure on how to manipulate the parameters to achieve this. It seems when I exceed a certain font size (to run past the label size), it gets pushed down to the next line instead of writing beyond the barcode. Is there a solution for this? My generation code:
//Set Aspose License
Aspose.BarCode.License license = new Aspose.BarCode.License();
license.SetLicense("Aspose.Total.lic");
//license.SetLicense("c:\\download\\Aspose.Total.lic");
//Split up the property tag code from the shelf code
//string[] splitbarcode = dtBarCodebyShelf.Rows[i]["barcode"].ToString().Trim().Split(',');
//Array.Resize(ref splitbarcode, splitbarcode.Length + 1);
BarcodeGenerator ptagbarcodegenerator = new BarcodeGenerator(EncodeTypes.Code39Standard, splitbarcode[0]);
ptagbarcodegenerator.Parameters.Resolution = 300;
// Set barcode height
ptagbarcodegenerator.Parameters.Barcode.BarHeight.Millimeters = 8.0f;
//Barcode density
//For Zebra DS8178 Scanner
//xDimension upper range: 9.85 mil = 0.00985 inch
//xDimension lower range: 3 mil = 0.003 inch
ptagbarcodegenerator.Parameters.Barcode.XDimension.Inches = 0.008f;
//Set Top Label visibility and text/text options
ptagbarcodegenerator.Parameters.CaptionAbove.Visible = true;
//Set Above Caption Text
ptagbarcodegenerator.Parameters.CaptionAbove.Text = "XXXX XX XXXXXXX XXXXXXX";
//Set Above Caption Font Size. 6 will fit, 10 causes the caption to wrap underneath
ptagbarcodegenerator.Parameters.CaptionAbove.Font.Size.Point = 10;
//Set above caption alignment
ptagbarcodegenerator.Parameters.CaptionAbove.Alignment = TextAlignment.Center;
//Set above caption Font
ptagbarcodegenerator.Parameters.CaptionAbove.Font.FamilyName = "Arial";
//Turn off encoded code text
ptagbarcodegenerator.Parameters.Barcode.CodeTextParameters.Location = CodeLocation.None;
//Turn on bottom label visibility
ptagbarcodegenerator.Parameters.CaptionBelow.Visible = true;
//Set bottom label text
ptagbarcodegenerator.Parameters.CaptionBelow.Text = "Property Tag #: " + splitbarcode[0] + Environment.NewLine + "Shelf #: " + splitbarcode[1];
//Set bottom label text alignment
ptagbarcodegenerator.Parameters.CaptionBelow.Alignment = TextAlignment.Center;
//Set bottom label text font
ptagbarcodegenerator.Parameters.CaptionBelow.Font.FamilyName = "Arial";
//Set bottom label font size. 6 will fit, 10 causes the caption to wrap underneath
ptagbarcodegenerator.Parameters.CaptionBelow.Font.Size.Point = 10;
ptagbarcodegenerator.Save("c:\\download\\barcode_" + splitbarcode[0] + ".png", BarCodeImageFormat.Png);