zoukankan      html  css  js  c++  java
  • C# 打印功能

    private void pd_PrintPage(object sender, PrintPageEventArgs e)        

    {            

      e.Graphics.DrawString("大家好", new Font("宋体", 10), new SolidBrush(System.Drawing.Color.Black), new PointF(10, 10));

                    Image image = Image.FromFile(@"D:Chrysanthemum.jpg");
                    e.Graphics.DrawImage(image, new PointF(20, 20));

    }        

    private void button3_Click(object sender, EventArgs e)        

    {            

    PrintDocument pd = new PrintDocument();       

    //获取打印机 默认第一个     

    pd.PrinterSettings.PrinterName = PrinterSettings.InstalledPrinters[0];            

    pd.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);            

    pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);            

    //打印预览            

    PrintPreviewDialog ppd = new PrintPreviewDialog();            

    ppd.Document = pd;            

    ppd.ShowDialog();            

    //打印机打印            

    //pd.Print();        

    }

  • 相关阅读:
    werfault进程使用CPU率高
    oracel 拆分字符串
    TCP TIME WAIT
    netstat 命令
    Java 理论与实践: 并发集合类
    DIV与SPAN之间有什么区别
    oracle超出打开游标的最大数的原因和解决方案
    Quartz表达式
    Axis创建webservice客户端和服务端
    Web服务cxf框架发布2
  • 原文地址:https://www.cnblogs.com/xiguanjiandan/p/3490896.html
Copyright © 2011-2022 走看看