iTextSharp.text.pdf.BarcodeEAN.GetBarsUPCE C# (CSharp) Метод

GetBarsUPCE() публичный статический Метод

public static GetBarsUPCE ( string _code ) : byte[]
_code string
Результат byte[]
        public static byte[] GetBarsUPCE(string _code) {
            int[] code = new int[_code.Length];
            for (int k = 0; k < code.Length; ++k)
                code[k] = _code[k] - '0';
            byte[] bars = new byte[TOTALBARS_UPCE];
            bool flip = (code[0] != 0);
            int pb = 0;
            bars[pb++] = 1;
            bars[pb++] = 1;
            bars[pb++] = 1;
            byte[] sequence = PARITYE[code[code.Length - 1]];
            for (int k = 1; k < code.Length - 1; ++k) {
                int c = code[k];
                byte[] stripes = BARS[c];
                if (sequence[k - 1] == (flip ? EVEN : ODD)) {
                    bars[pb++] = stripes[0];
                    bars[pb++] = stripes[1];
                    bars[pb++] = stripes[2];
                    bars[pb++] = stripes[3];
                }
                else {
                    bars[pb++] = stripes[3];
                    bars[pb++] = stripes[2];
                    bars[pb++] = stripes[1];
                    bars[pb++] = stripes[0];
                }
            }
            bars[pb++] = 1;
            bars[pb++] = 1;
            bars[pb++] = 1;
            bars[pb++] = 1;
            bars[pb++] = 1;
            bars[pb++] = 1;
            return bars;
        }