使用ItextSharp创建后如何打开PDF文件 [英] How to open PDF file once created with ItextSharp

查看:124
本文介绍了使用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);
}


这篇关于使用ItextSharp创建后如何打开PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆