2010-01-20 165 views

回答

1

一个好的框架是pdfSharp

您可以捕捉表单(有几种方法可以完成,this是一个样本)。 比写图片流一个PDF对象(你可以在pdfSharp网站找到很多这样的例子)。

1

您可以使用绘图方法来捕获窗体的整个客户区,然后使用Print方法来打印它们。

Graphics myGraphics = this.CreateGraphics(); 
Size s = this.Size; 
memoryImage = new Bitmap(s.Width, s.Height, myGraphics); 
Graphics memoryGraphics = Graphics.FromImage(memoryImage); 
memoryGraphics.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s); 

然后使用PrintDocument类来打印它。