c# - How do I print from the wpf WebBrowser available in .net 3.5 SP1? -


We currently print a application using WindowsFormsHost and 'WebBrowser.ShowPrintDialog ()' in your application using a Windfrom Webbrowser control. We have a problem with this that the dialogue is not considered a modal and if a print attempts later, the parent window can be dismissed.

I was looking at the new wpf webbroser control in hope that they decide this issue, whenever you do that, but there is no way to print it.

I'm talking about doing something online:

  print-out printed = new printed (); PrintDialog.PrintDocument ((IDocumentPaginatorSource webBrowser.Document). Document Designer, "My App");  

But it throws an exception as a webbrowser. Document IDocumentPaginatorSource does not support the interface.

Can I print from the WPF web browser control?

Thanks

I am using this, and it works:

  mshtml.IHTMLDocument2doc = webBrowser.Document as mshtml.IHTMLDocument2; Doc.execCommand ("print", true, zero);  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -