我现在用I/O流变量mStream保存了pdf的二进制,我怎样才能把它打开?
用下面这个方法可以吗?
1.自己电脑上装了pdf阅读器,添加了Acrobat的引用,然后定义一个AcroAppClass 类acrobatApp,怎样打开那个mStream。
2.用Process.Start(**)的方式,好像只能打开string,这个string保存的是pdf文件的路径

解决方案 »

  1.   

    楼主想要什么 “容器”来显示  .pdf文件?
      pdf阅读器?
      

  2.   

    using (T_JOB_Access dal = new T_JOB_Access() ) //dal对象
    {
      model = dal.QueryCondition(" WHERE JOB_ACCESSORY_ID = " + JobAccId);  string strFileName = HttpUtility.UrlEncode(model.JOB_ACCESSORY_NAME);//保存的文件名
      Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); 
      Response.ContentType = "application/octet-stream";
      Response.AddHeader("Content-Disposition", "attachment;FileName= " + strFileName);
      Response.BinaryWrite(model.JOB_ACCESSORY_CONTENT); //JOB_ACCESSORY_CONTENT字段存放文件二进制内容
      Response.End();
    }
      

  3.   

    只要能显示就可以了,pdf阅读器也可以
      

  4.   

    全能的pdf瀏覽,編輯,建立通殺http://www.tallcomponents.com/
    my blog
    http://ufo-crackerx.blog.163.com/
      

  5.   

    http://www.codeproject.com/KB/DLL/PDF2TXTVB.aspx
      

  6.   

    从数据库里读出pdf数据,二进制流保存在mStream中,要用本地的pdf阅读器打开此pdf文件。C#代码如下:
    public void StreamToFile(Stream stream, string fileName)
      {
        // 把 Stream 转换成 byte[]
        byte[] bytes = new byte[stream.Length];
        stream.Read(bytes, 0, bytes.Length);
         // 设置当前流的位置为流的开始
         stream.Seek(0, SeekOrigin.Begin);
         // 把 byte[] 写入文件
         FileStream fs = new FileStream(fileName, FileMode.OpenOrCreate);
         BinaryWriter bw = new BinaryWriter(fs);
         bw.Write(bytes);
         bw.Close();
         fs.Close();
      }
    然后定义一个Process类,Process pr; pr.Start(fileName);