我在c#中使用webbrowser控件来打印html文件。当我用当前的导航器(Firefox或Chrome)打开html文件时,我的页面“非常好”,我必须确切地打印它,看看它。但是当我在c#中使用webbrowser控件时,它就像webbrowser添加一个“margin-left”属性,并且我的文档不居中。http://imgur.com/q7ovEA1我也想删除这个“page 1 of 1”和标题。 我知道,在C#中使用Internet Explorer浏览器控件,这就是为什么我说这在我的HTML文件:webbrowser在打印html文件时添加一个页边空白
http-equiv="X-UA-Compatible" content="IE=edge
但这并不解决问题。
Visual Studio在第一行返回一个NullPointerException:/ – Keenegan
在[DocumentCompleted](http://msdn.microsoft.com/zh-cn/library/system.windows.forms.webbrowser.documentcompleted)上运行此代码。 aspx)事件,当'webBrowser.Document'确实存在时。 – Noseratio
好的,这里是我有http://imgur.com/GdFdBEU – Keenegan