使用IE 11,Windows 8.1.
我将以下内容插入到Windows窗体应用程序中:
var html = "" + "
View Larger Map"; webBrowser1.DocumentText = (html);
现在我想打印这个,但是当我进入printpreview时它没有显示方向线
private void button1_Click(object sender, EventArgs e) { this.webBrowser1.ShowPrintPreviewDialog(); }
我尝试过不同的浏览器模拟,但仍无法在谷歌地图中打印方向线.IE6 - 11没有运气.
SetBrowserFeatureControlKey("FEATURE_BROWSER_EMULATION", fileName, GetBrowserEmulationMode()); public static UInt32 GetBrowserEmulationMode() { int browserVersion = 7; using (var ieKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer", RegistryKeyPermissionCheck.ReadSubTree, System.Security.AccessControl.RegistryRights.QueryValues)) { var version = ieKey.GetValue("svcVersion"); if (null == version) { version = ieKey.GetValue("Version"); if (null == version) throw new ApplicationException("Microsoft Internet Explorer is required!"); } int.TryParse(version.ToString().Split('.')[0], out browserVersion); } // Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Default value for Internet Explorer 10. UInt32 mode = 11000; switch (browserVersion) { case 7: // Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode. Default value for applications hosting the WebBrowser Control. mode = 7000; break; case 8: // Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode. Default value for Internet Explorer 8 mode = 8000; break; case 9: // Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode. Default value for Internet Explorer 9. mode = 9000; break; case 10: // Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode. Default value for Internet Explorer 9. mode = 10000; break; default: // use IE10 mode by default break; } return mode; }
任何人都可以帮我找出为什么这不打印方向线?请记住,直接将此html插入.html文件并使用IE打开,将显示方向线.但他们不打印.
更新
使用IE,您可以将以下内容插入到扩展名为html的文档中.
View Larger Map
这将在firefox中正确打印所有内容.我已经在多台打印机上测试过了.
这在IE中无法正确打印.我尝试过以下方法:
https://support.google.com/maps/answer/21849?hl=en
关于如何让线条出现的任何想法?