winform 使用打印机
工具箱里的pageSetupDialog ,printDialog,printDocument,printPreviewDialog 拖到屏幕上
用printDocument 调用print()方法
this.printDocument1.Print();
实现printDocument 的 PrintPage方法
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{
Font font = new Font("宋体", 14);
Font font1 = new Font("宋体", 11);
Brush bru = Brushes.Black;
e.Graphics.DrawString("XXXXXX ", font, bru, 130, 35);
e.Graphics.DrawString("订单号: ", font1, bru, 100, 65);
e.Graphics.DrawString("13216543214313", font1, bru, 185, 65);
e.Graphics.DrawString("XXXXXX:", font1, bru, 350, 65);
e.Graphics.DrawString("XXXXXX", font1, bru, 400, 65);
...
}
网友评论