1

I had a situation like creating a pdf file from the winform, which have to make entire winform as a pdf, most of the searching in the google resulted in capturing the screen and making the pdf of that, but the problem is that it will not be useful if the form is lengthy, and it have scroll bars.

I referred to these links which are not much useful

convert windows form to pdf file

Save WinForm to PDF & print multipage WinForm

Any help would be greatly appreciated

Community
  • 1
  • 1
Raghurocks
  • 917
  • 7
  • 17
  • Certainly you can insert a multi-line textbox into PDF (with I think no more than approx 65,000 chars). There are many software solutions to create PDF Forms and you can set the text of that form field to your scrollable form. – Kevin Brown Aug 21 '13 at 05:40
  • I doesn't mean that lengthy form is due to the multiline textbox it is because of the more content controls @KevinBrown – Raghurocks Aug 21 '13 at 05:56
  • Maybe: http://social.msdn.microsoft.com/Forums/en-US/2ad34554-e989-4ffa-8e1f-ccea1f00c99d/how-to-print-scrollable-textbox – rheitzman Aug 21 '13 at 14:25

1 Answers1

0

Try this

    var form = new Form1();
    var bitmap = new System.Drawing.Bitmap(form.Width,form.Height);
    form.DrawToBitmap(bitmap, form.Bounds);
    bitmap.Save("file.jpg", ImageFormat.Jpeg);
    bitmap.Dispose();
Vasiliy
  • 492
  • 3
  • 11