Hi Expert! How to print HTML document using command line and C#. Thanks in advance
How do I print an HTML document from a web service? alexander sabato 3406 04 Feb 2013 Hi Expert! How to print HTML document using command line and C#. Thanks in advance
Hi Alexander Sabato!
Run this command into command prompt
rundll32.exe %WINDIR%\System32\mshtml.dll,PrintHTML "FilePath"
If you are using C#, than used line of code as below
using (Process printProcess = new Process()) { string systemPath = Environment.GetFolderPath(Environment.SpecialFolder.System); printProcess.StartInfo.FileName = systemPath + @"\rundll32.exe"; printProcess.StartInfo.Arguments = systemPath + @"\mshtml.dll,PrintHTML """ + FilePath + @""""; printProcess.Start(); }Note: Here "FilePath", represent path of document which you want to print.