开发者

Printing content of WebBrowser Control in C#

开发者 https://www.devze.com 2023-01-21 19:59 出处:网络
I want to print data present in Webbrowser Control. My data is loaded from datatable which contains HTML formatted text. When I tried t开发者_Python百科o print it with RichTextBox it was not able to r

I want to print data present in Webbrowser Control. My data is loaded from datatable which contains HTML formatted text. When I tried t开发者_Python百科o print it with RichTextBox it was not able to recognize HTML controls and was not able to render.

But when I tried to print using webbrowser control, noting gets printed. How to achieve this.

webBrowser1.DocumentText = dt.Rows[0].Field<string>("WAIVER_TERMS");
webBrowser1.Print()


Did you try IWebBrowser2.ExecWB(OLECMDID_PRINT)? It should work, I've used succesully many time.

0

精彩评论

暂无评论...
验证码 换一张
取 消