开发者

Printing a WebBrowser in a foreach loop

开发者 https://www.devze.com 2023-01-15 04:54 出处:网络
I have a collection of URLs in an arra开发者_JAVA技巧ylist. Now, I need to print the webpage in each URL using the WebBrowser control in my Windows Forms applcaition. Can anyone please help me out on

I have a collection of URLs in an arra开发者_JAVA技巧ylist. Now, I need to print the webpage in each URL using the WebBrowser control in my Windows Forms applcaition. Can anyone please help me out on how to do this? Thank you.


1). Call IWebBrowser2.Navigate(..) to start loading a document. 2). Handle NavigateComplete() event. When the document is loaded you can print it: IHTMLDocument2.execCommand("print", null, null)

In the real world you need to handle errors, provide timeouts, as url can be wrond, server could be down etc.

Good luck!

0

精彩评论

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