繁体   English   中英

带图片打印表格

[英]Printing form with pictures

我正在尝试打印出客户填写的表格以供他们签名,然后存储在我们的文件夹中,但是我不知道如何正确打印表格。 我已经在网上尝试了无数的指南或教程,但是我只能对表格进行拍照并打印出来,看起来很糟糕。

我可以通过任何方式以专业质量打印包含控件,标签和图片的表格吗? 我听说过Visual Studio的插件可能能够做到这一点,而且如果不太麻烦,那么价格可能就不会太大。

如果重要的话,我所有的控件都包含在form2中,并且打印也将通过form2中的菜单按钮进行。

谢谢!

PrintDocument将是必经之路。 它使用GDI+绘制到文档的表面。 您现在负责布局。

 private void pd_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs)
   {
   single yPos = 0;
   int count = 0;
   single leftMargin = e.MarginBounds.Left;
   single topMargin = e.MarginBounds.Top;
   Image img = Image.FromFile({path to img});
   Rectangle logo = New Rectangle(40,40,50,50);
   using (Font printFont = new Font("Arial", 10.0f))
    { 
     e.Graphics.DrawImage(img, logo);
     e.Graphics.DrawString(textbox1.Text, printFont, Brushes.Black, leftMargin, yPos, New StringFormat());
    }
   //etc...
   //taken from the example and added how to draw the text from a textbox
   }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM