Пример #1
0
        private GoldPrinter.TextItem NewItem(DataRow ti)
        {
            GoldPrinter.TextItem item = new GoldPrinter.TextItem();

            if ((ti != null))
            {
                item.X      = (int)cMm.Cm2Pix((float)cMm.GetDBInt(ti["X"])); //- SysX
                item.Y      = (int)cMm.Cm2Pix((float)cMm.GetDBInt(ti["Y"])); // - SysY
                item.Width  = (int)cMm.Cm2Pix((float)cMm.GetDBInt(ti["Width"]));
                item.Height = (int)cMm.Cm2Pix((float)cMm.GetDBInt(ti["Height"]));
                if (cMm.GetDBInt(ti["FontSize"]) <= 0)
                {
                    ti["FontSize"] = 11;
                }
                item.Font = new Font(Convert.ToString(ti["FontName"] + ""), cMm.GetDBInt(ti["FontSize"]));
                item.Text = ti["TemplateID"] + "";
            }
            else
            {
                item = null;
            }


            return(item);
        }
Пример #2
0
        private void DrawTemplate()
        {
            int i = 0;

            GoldPrinter.TextItem item = default(GoldPrinter.TextItem);
            DataRow row = null;

            for (i = 0; i <= this.templateItems.Rows.Count - 1; i++)
            {
                row  = this.templateItems.Rows[i];
                item = NewItem(row);
                if ((item != null))
                {
                    printerObject.AddTextItem(item);
                }
            }
        }