【发布时间】:2010-01-20 12:50:35
【问题描述】:
如何将多页 WinForm 保存为 PDF 以及如何打印?
谢谢, 关门
【问题讨论】:
如何将多页 WinForm 保存为 PDF 以及如何打印?
谢谢, 关门
【问题讨论】:
您可以使用paint方法来捕获Form的整个客户区域,然后使用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 类进行打印。
【讨论】: