我需要打印用c#代碼創建的html文件。我有一個過程來完成它:在c#中打印htm文件,無需頁頭和頁腳
System.IO.File.WriteAllText("1.html",printHtml,Encoding.UTF8);
Process printjob = new Process();
printjob.StartInfo.FileName = "1.html";
printjob.StartInfo.UseShellExecute = true;
printjob.StartInfo.Verb = "print";
printjob.StartInfo.CreateNoWindow = true;
printjob.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
printjob.Start();
打印的文檔包含默認標題(頁頭10F X)和默認頁腳(文件URL)我。怎麼可以打印HTML文件沒有這個頁眉和頁腳?