0

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

thanks, Ofir

Iain Holder
  • 14,172
  • 10
  • 66
  • 86
Ofir
  • 9
  • 1
  • 2

2 Answers2

1

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

sagie
  • 2,998
  • 3
  • 22
  • 31
1

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.

Code Name Jack
  • 2,856
  • 24
  • 40