Posted
Filed under 분류없음
http://stackoverflow.com/questions/7676773/how-to-print-html-in-c-sharp

[다이얼 로그 없이 처리]
[참조] : http://stackoverflow.com/questions/419412/print-html-document-from-windows-service-without-print-dialog

private void PrintHelpPage()
{
   
// Create a WebBrowser instance.
   
WebBrowser webBrowserForPrinting = new WebBrowser();

   
// Add an event handler that prints the document after it loads.
    webBrowserForPrinting
.DocumentCompleted +=
       
new WebBrowserDocumentCompletedEventHandler(PrintDocument);

   
// Set the Url property to load the document.
    webBrowserForPrinting
.Url = new Uri(@"\\myshare\help.html");
}

private void PrintDocument(object sender,
   
WebBrowserDocumentCompletedEventArgs e)
{
   
// Print the document now that it is fully loaded.
   
((WebBrowser)sender).Print();

   
// Dispose the WebBrowser now that the task is complete.
   
((WebBrowser)sender).Dispose();
}
2012/10/11 10:27 2012/10/11 10:27