如何在新选项卡中打开动态生成的PDF

时间:2016-02-05 05:00:56

标签: c# asp.net pdf-generation itextsharp

以下是我在同一标签中显示pdf的代码。

。 。 。 。

tablenew.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
                tablenew.AddCell(new Phrase("", time4));
                tablenew.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT;
                tablenew.AddCell(new Phrase(total.ToString(), times1));
                pdfDoc.Add(tablenew);

                pdfDoc.Close();
                Response.ContentType = "application/pdf";
                Response.AddHeader("content-disposition", "inline;" + "filename=FeesReceiptBY" + Name + ".pdf");

                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.Write(pdfDoc);
                Response.End();

此代码段适用于在同一标签中显示pdf。请帮助我对新标签中的视图生成pdf执行相同的操作。谢谢

0 个答案:

没有答案