【发布时间】:2013-10-04 11:45:05
【问题描述】:
我有HTML 文档作为从SSRS 检索到的字节[],我想以C5 纸张格式以横向表示形式打印它。我使用 IE 进行打印,但我不知道如何告诉他以横向 C5 模式打印我的文档。有什么建议吗?
var envelope = proxy.Render(
Format, DevInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
using (FileStream fStream = File.Create(string.Format(@"printtmp\envelope_{0}.html", i)))
{
fStream.Write(envelope, 0, envelope.Length);
}
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format(@"printtmp\envelope_{0}.html", i));
var ie = new InternetExplorer();
ie.PrintTemplateTeardown += disp =>
{
File.Delete(path);
ie.Quit();
};
ie.DocumentComplete += (object disp, ref object url) =>
{
ie.ExecWB(OLECMDID.OLECMDID_PRINT, OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, Type.Missing, Type.Missing);
};
ie.Navigate(path, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
【问题讨论】:
标签: c# html .net printing webbrowser-control