code-tutorial.com

The best resources for developers

How can I print an HTML document from a web service?

using (Process printProcess = new Process())
{
    string systemPath = Environment.GetFolderPath(Environment.SpecialFolder.System);
    printProcess.StartInfo.FileName = systemPath + @"
undll32.exe";
    printProcess.StartInfo.Arguments = systemPath + @"mshtml.dll,PrintHTML """ + fileToPrint + @"""";
    printProcess.Start();
}

Tags: html c# printing web-services

Source: By Chris Marasti-Georg as answer to the question

This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 4.0


Related code-snippets: