Exemple #1
0
        public SetPrint_Form(ModuleSettings settings)
        {
            InitializeComponent();
            this.settings = settings;

            pf = new Print_form(Convert.ToInt16(210 * 4), Convert.ToInt16(297 * 4));

            ksddtxt           = new CTextPrintObjSet();
            ksddtxt.Printtext = "¿¼ÊԵصã";
            ksddtxt.mmX       = settings.Ksdd_x;
            ksddtxt.mmY       = settings.Ksdd_y;
            ksdd_x.Text       = settings.Ksdd_x.ToString();
            ksdd_y.Text       = settings.Ksdd_y.ToString();
            pf.PrintRegister(ksddtxt);

            ksxmtxt           = new CTextPrintObjSet();
            ksxmtxt.Printtext = "¿¼ÉúÐÕÃû";
            ksxmtxt.mmX       = settings.Ksxm_x;
            ksxmtxt.mmY       = settings.Ksxm_y;
            ksxm_x.Text       = settings.Ksxm_x.ToString();
            ksxm_y.Text       = settings.Ksxm_y.ToString();
            pf.PrintRegister(ksxmtxt);

            kscjtxt           = new CTextPrintObjSet();
            kscjtxt.Printtext = "¿¼ÊԳɼ¨";
            kscjtxt.mmX       = settings.Kscj_x;
            kscjtxt.mmY       = settings.Kscj_y;
            kscj_x.Text       = settings.Kscj_x.ToString();
            kscj_y.Text       = settings.Kscj_y.ToString();
            pf.PrintRegister(kscjtxt);

            ksrqtxt           = new CTextPrintObjSet();
            ksrqtxt.Printtext = "¿¼ÊÔÈÕÆÚ";
            ksrqtxt.mmX       = settings.Ksrq_x;
            ksrqtxt.mmY       = settings.Ksrq_y;
            ksrq_x.Text       = settings.Ksrq_x.ToString();
            ksrq_y.Text       = settings.Ksrq_y.ToString();
            pf.PrintRegister(ksrqtxt);

            ksyxmtxt           = new CTextPrintObjSet();
            ksyxmtxt.Printtext = "¿¼ÊÔÔ±ÐÕÃû";
            ksyxmtxt.mmX       = settings.Ksyxm_x;
            ksyxmtxt.mmY       = settings.Ksyxm_y;
            ksyxm_x.Text       = settings.Ksyxm_x.ToString();
            ksyxm_y.Text       = settings.Ksyxm_y.ToString();
            pf.PrintRegister(ksyxmtxt);

            tiaomaimg         = new CImagePrintObjSet();
            tiaomaimg.InImage = Code128Rendering.MakeBarcodeImage("²âÊÔÔ±100", 1, true);
            tiaomaimg.mmX     = settings.Tiaomaimg_x;
            tiaomaimg.mmY     = settings.Tiaomaimg_y;
            pf.PrintRegister(tiaomaimg);
        }
Exemple #2
0
        public CPrintContent()
        {
            settings = ModuleConfig.GetSettings();

            ksddtxt           = new CTextPrintObjSet();
            ksddtxt.Printtext = "";
            ksddtxt.mmX       = settings.Ksdd_x;
            ksddtxt.mmY       = settings.Ksdd_y;
            ksddtxt.Fn        = new Font("宋体", settings.FontSize);

            ksxmtxt           = new CTextPrintObjSet();
            ksxmtxt.Printtext = "";
            ksxmtxt.mmX       = settings.Ksxm_x;
            ksxmtxt.mmY       = settings.Ksxm_y;
            ksxmtxt.Fn        = new Font("宋体", settings.FontSize);

            kscjtxt           = new CTextPrintObjSet();
            kscjtxt.Printtext = "";
            kscjtxt.mmX       = settings.Kscj_x;
            kscjtxt.mmY       = settings.Kscj_y;
            kscjtxt.Fn        = new Font("宋体", settings.FontSize);

            ksrqtxt           = new CTextPrintObjSet();
            ksrqtxt.Printtext = "";
            ksrqtxt.mmX       = settings.Ksrq_x;
            ksrqtxt.mmY       = settings.Ksrq_y;
            ksrqtxt.Fn        = new Font("宋体", settings.FontSize);

            ksyxmtxt           = new CTextPrintObjSet();
            ksyxmtxt.Printtext = "";
            ksyxmtxt.mmX       = settings.Ksyxm_x;
            ksyxmtxt.mmY       = settings.Ksyxm_y;
            ksyxmtxt.Fn        = new Font("宋体", settings.FontSize);

            tiaomaimg     = new CImagePrintObjSet();
            tiaomaimg.mmX = settings.Tiaomaimg_x;
            tiaomaimg.mmY = settings.Tiaomaimg_y;

            printDocument1 = new System.Drawing.Printing.PrintDocument();
            this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage);
        }