【发布时间】:2010-03-18 04:35:15
【问题描述】:
我正在使用 ITextSharp 即时生成 pdf,然后将其保存到磁盘并使用 Frame 显示。
Frame 有一个名为 src 的属性,我在其中传递生成的文件名。
这一切都很好我想要实现的是将生成的 pdf 文件传递给 Frame 而不将其保存到磁盘。
HtmlToPdfBuilder builder = new HtmlToPdfBuilder(PageSize.LETTER);
HtmlPdfPage first = builder.AddPage();
//import an entire sheet
builder.ImportStylesheet(Request.PhysicalApplicationPath + "CSS\\Stylesheet.css");
string coupon = CreateCoupon();
first.AppendHtml(coupon);
byte[] file = builder.RenderPdf();
File.WriteAllBytes(Request.PhysicalApplicationPath+"final.pdf", file);
printable.Attributes["src"] = "final.pdf";
【问题讨论】:
标签: c# asp.net pdf itextsharp