示例#1
0
        public static IList <ReceiptRow> CreateRows(string text, Font font)
        {
            var rows = new List <ReceiptRow>();

            if (string.IsNullOrEmpty(text))
            {
                return(rows);
            }
            var textArr   = text.Split('\n');
            var rowLength = ReceiptFont.CharsInRow(font);

            foreach (var str in textArr)
            {
                var s = str;
                while (!string.IsNullOrEmpty(s))
                {
                    rows.Add(new ReceiptRow()
                    {
                        Text = CutContent(ref s, rowLength),
                        Font = font
                    });
                }
            }
            return(rows);
        }
示例#2
0
 private void AddSeparator(char c)
 {
     AddRow("".PadRight(ReceiptFont.CharsInRow(ReceiptFont.Font16), c), ReceiptFont.Font16);
 }