Good day!
There was a following task: there is a WPF-window, on which standard WebBrowser. When you load a window, it displays xml / xslt through NavigateToStream . For the displayed data, the print function via mshtml :
mshtml.IHTMLDocument2 doc = WBrowser.Document as mshtml.IHTMLDocument2; doc.execCommand("Print", true, 0); Problem: css-background is ignored when printing.
Found a solution through a modification of the page settings dialog in the registry:
RegistryKey regKey = Registry.CurrentUser .OpenSubKey("Software", true) .OpenSubKey("Microsoft", true) .OpenSubKey("Internet Explorer", true) .OpenSubKey("PageSetup", true); var defaultValue = regKey.GetValue("Print_Background"); regKey.SetValue("Print_Background", "yes"); Question: Is it possible to solve the problem without modifying the registry?
Thank!