一个项目用的是 Argox A-150 条码打印机,做水晶报表打印时一直打印在中间,而且打印不完全,求助高手解决办法.打印机直接安装在开发机上,纸张设置是直接用打印机上的纸张去设置的,求高手帮忙解决.

解决方案 »

  1.   

    另外我在说一点,标签纸都比较小,printDocument直接输出,而又不需要客户去看到这个from,这样打印也比较完美。
    我贴点代码给你看,希望你能明白。
    ////字体设置
                    ////this.dateTimePicker1.Format=dateTimePicker1.CustomFormat;
                    ////dateTimePicker1.CustomFormat = "yyyy-MM-dd";
                    ////System.DateTime currentTime = new System.DateTime();                 //DateTime date = DateTime.Now;
                    //String format = "u";
                    //string year = DateTime.Now.Year.ToString();
                    //string month = date.ToString(format).Substring(5, 2);
                    //string day = date.ToString(format).Substring(8, 2);
                    /////字体纵向
                    //System.Drawing.StringFormat drawFormat = new System.Drawing.StringFormat();
                    //drawFormat.FormatFlags = StringFormatFlags.DisplayFormatControl;                //Font bFont = new Font("黑体", 12, FontStyle.Regular);//小标签
                    //Font lFont = new Font("黑体", 14, FontStyle.Regular);//大标签
                    ////e.Graphics.DrawImage(this.pictureBox3.Image, 50, 50, 279, 1000);                //#region 1号帖
                    ////旋转绘图平面     
                    ////倒影文字                //e.Graphics.RotateTransform(180);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["质检员"].Value.ToString(), bFont, Brushes.Black, -90, -65);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["等级"].Value.ToString(), bFont, Brushes.Black, -180, -65);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["净重"].Value.ToString(), bFont, Brushes.Black, -270, -65);                //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["班次"].Value.ToString(), bFont, Brushes.Black, -90, -125);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["日期"].Value.ToString(), bFont, Brushes.Black, -190, -125);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["规格"].Value.ToString(), bFont, Brushes.Black, -265, -125);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["批号"].Value.ToString(), bFont, Brushes.Black, -195, -190);
                    //e.Graphics.ResetTransform();                //Code39 c39 = new Code39();
                    //c39.Height = 180;
                    //c39.Magnify = 1;
                    //c39.ViewFont = new Font("宋体", 20);
                    //e.Graphics.RotateTransform(90);                //e.Graphics.DrawImage(c39.GetCodeImage(dataGridView1.CurrentRow.Cells["条形码"].Value.ToString(), Code39.Code39Model.Code39Normal, true), 480, -55, 190, 40);//条形码
                    //e.Graphics.DrawImage(c39.GetCodeImage(dataGridView1.CurrentRow.Cells[
                    //    "条形码"].Value.ToString(), Code39.Code39Model.Code39Normal, true), 940, -55, 190, 40);//条形码  原始宽度129                //#endregion                //string guige = dataGridView1.CurrentRow.Cells["厚度"].Value.ToString() + "µm*" + dataGridView1.CurrentRow.Cells["规格"].Value.ToString() + "mm*" + dataGridView1.CurrentRow.Cells["长度"].Value.ToString() + "m";                //#region 2号贴
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["电晕面"].Value.ToString(), lFont, Brushes.Black, 280, -90, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["净重"].Value.ToString(), lFont, Brushes.Black, 280, -130, drawFormat);
                    //e.Graphics.DrawString(guige, lFont, Brushes.Black, 280, -170, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["型号"].Value.ToString(), lFont, Brushes.Black, 280, -210, drawFormat);
                    //e.Graphics.DrawString("食品用", lFont, Brushes.Black, 600, -170, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["等级"].Value.ToString(), lFont, Brushes.Black, 455, -90, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["班次"].Value.ToString(), lFont, Brushes.Black, 600, -90, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["日期"].Value.ToString(), lFont, Brushes.Black, 455, -130, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["批号"].Value.ToString(), lFont, Brushes.Black, 455, -210, drawFormat);                //#endregion                //#region 3号帖                //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["电晕面"].Value.ToString(), lFont, Brushes.Black, 770, -90, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["净重"].Value.ToString(), lFont, Brushes.Black, 770, -130, drawFormat);
                    //e.Graphics.DrawString(guige, lFont, Brushes.Black, 770, -170, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["型号"].Value.ToString(), lFont, Brushes.Black, 770, -210, drawFormat);
                    //e.Graphics.DrawString("食品用", lFont, Brushes.Black, 1090, -170, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["等级"].Value.ToString(), lFont, Brushes.Black, 940, -90, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["班次"].Value.ToString(), lFont, Brushes.Black, 1090, -90, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["日期"].Value.ToString(), lFont, Brushes.Black, 940, -130, drawFormat);
                    //e.Graphics.DrawString(dataGridView1.CurrentRow.Cells["批号"].Value.ToString(), lFont, Brushes.Black, 940, -210, drawFormat);