我需要打印在 c# 代码中创建的 html 文件。我已经通过一个过程做到了:
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();
打印的文档包含默认页眉(X 页第 1 页)和默认页脚(文件 url)。如何打印没有此页眉和页脚的 html 文件?