开发者

Save WinForm to PDF & print multipage WinForm [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 6 years ago.

Improve this questio开发者_开发知识库n

How can I save multipage WinForm to PDF & how can I print it?

thanks, Ofir


A good framework is pdfSharp.

You can capture the form (there are few ways of doing it, this is one sample). Than write the image stream a pdf object (you can find many samples for this in the pdfSharp web site).


You can use paint method to capture the entire client area of your Form and then use the Print method to print them.

 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);

then use PrintDocument class to print it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜