private static void PrintBarcodeText(RenderContext context, string barcodeStr, double barcodeStringHeight, double barcodeWidth, double offsetLeft, double barHeight) { var barStr = new PrintableElement { ElementType = ElementType.Text, Height = barcodeStringHeight, Width = barcodeWidth - offsetLeft, X = context.CurrentX + offsetLeft, Y = context.CurrentY + barHeight, Value = barcodeStr }; barStr.AddProperty(PrintableElementProperty.FontFamily, "Courier New"); barStr.AddProperty(PrintableElementProperty.FontSize, BarcodeStringFontSize); barStr.AddProperty(PrintableElementProperty.Align, "Left"); context.AddElement(barStr); }
private void PrintBarcodeLabel(RenderContext context, double barcodeHeight) { var label = new PrintableElement { ElementType = ElementType.Text, Height = this.LabelFontSize, Width = barcodeHeight, X = context.CurrentX, Y = context.CurrentY + barcodeHeight, Value = this.Label }; label.AddProperty(PrintableElementProperty.Rotate, -90); label.AddProperty(PrintableElementProperty.Align, "Center"); label.AddProperty(PrintableElementProperty.FontSize, this.LabelFontSize); context.AddElement(label); }