使用ItextSharp创建后如何打开PDF文件

问题描述:


我已经使用pdf中的ItextSharp创建了一个pdf文件.它创建了pdf文件.创建后,我需要显示pdf文件.


请建议我

在此先感谢您.

Hi
I have created a pdf file using ItextSharp in pdf. it created pdf file. I need to show the pdf file once it created.


Please suggest me

Thanks in advance.

创建pdf文件后,您可以按以下方式呈现文件.

Once the pdf file is created you can render the file as following.

Byte[] buffer = [PDF Content data in bytes]

if (buffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
}