views:

83

answers:

0

I want to show a print preview dialog for a WebBrowser control that I have in a WinForms application. I am using .NET framework 3.5. I am aware that I can show a print preview dialog as follows:

webBrowser1.ShowPrintPreviewDialog();

But I would like to perform some operations on that dialog, namely specify its size. In order to do this I supposedly need to manually create the print preview dialog as follows:

PrintPreviewDialog dialog = new PrintPreviewDialog();
dialog.Document = printDoc;
dialog.ShowDialog();

The question is, where do I get this printDoc object? The type is PrintDocument. How do I extract a PrintDocument object, or create a PrintDocument object, from my WebBrowser control?