Saroj kumar

Saroj kumar

  • NA
  • 89
  • 2k

Printer setting programmatically when use Webbrowser control

Aug 18 2020 1:06 AM
I use given code for printing. My printing code work properly .now i want to add printer setting code and my html code go on printer for print also manage size of page.
please help me . 
public String stb { get; set; }
 
if (stb != null)
{
WebBrowser webBrowserForPrinting = new WebBrowser();
webBrowserForPrinting.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(PrintDocument);
webBrowserForPrinting.DocumentText = stb;
}
 
private void PrintDocument(object sender, WebBrowserDocumentCompletedEventArgs e)
{
((WebBrowser)sender).Print();
((WebBrowser)sender).Dispose();
}