Reputation: 3168
Here is what I'm trying to do:
WebBrowser
control on it along with Print (ShowPrintDialog()
) and Print Preview (ShowPrintPreviewDialog()
) buttons, Now the flow is manual, but is there any way I can automate this by loading series of documents into the browser control and directly send it to printing queue without any user intervention? I'm not sure if its technically a batch printing as I'm not sending file to be printed directly to the print queue. Note that Browser control is in the picture here since printed document is essentially WYSWYG as on Browser control.
Upvotes: 1
Views: 823
Reputation: 7629
You can simply use the Print()
method of WebBrowser
if you put it into the DocumentCompleted event:
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser1.Print();
}
After the print you can pass to the next page to print:
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser1.Print();
webBrowser1.Navigate(nextPage());
}
The only thing you need now is to make the WebBrowser
navigate to the first page (you can set it on the constructor of the form)
Upvotes: 1