当前位置:编程学习 > C#/ASP.NET >>

PrintDocument打印问题

先贴代码 protected void btnPrint_Click(object sender, EventArgs e)
    {
        
        PrintDocument pd = new PrintDocument();
         x=pd.DefaultPageSettings.Margins.Left;
         y = pd.DefaultPageSettings.Margins.Top;
        pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
        pd.Print();
    }

    void pd_PrintPage(object sender, PrintPageEventArgs e)
    {
        Graphics g = e.Graphics;
        System.Drawing.Image a ;
        if (txtCode.Text != "")
        {
            a = BarCodeHelper.MakeBarcodeImage(txtCode.Text, 2, false);
            g.DrawImage(a, 20, 120, 100, 70);
        }
            //获取用于绘制页面的Graphics的对象
           g.DrawString("我的姓名", new Font("黑体", 13,System.Drawing.FontStyle.Bold), new SolidBrush(Color.Black), new PointF(0, 0));
           g.DrawString("韩昭东", new Font("黑体", 13, 
           g.Dispose();
    }
问题,程序本地运行正常,打印正常,发布后挂在服务器,运行正常,打印不好使 pd 服务器 发布
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,