iTextSharp.text.pdf.BarcodePostnet.PlaceBarcode C# (CSharp) Метод

PlaceBarcode() публичный Метод

public PlaceBarcode ( PdfContentByte cb, Color barColor, Color textColor ) : Rectangle
cb PdfContentByte
barColor Color
textColor Color
Результат iTextSharp.text.Rectangle
        public override Rectangle PlaceBarcode(PdfContentByte cb, Color barColor, Color textColor) {
            if (barColor != null)
                cb.SetColorFill(barColor);
            byte[] bars = GetBarsPostnet(code);
            byte flip = 1;
            if (codeType == PLANET) {
                flip = 0;
                bars[0] = 0;
                bars[bars.Length - 1] = 0;
            }
            float startX = 0;
            for (int k = 0; k < bars.Length; ++k) {
                cb.Rectangle(startX, 0, x - inkSpreading, bars[k] == flip ? barHeight : size);
                startX += n;
            }
            cb.Fill();
            return this.BarcodeSize;
        }