我使用object对象,让pdf文件在网页中显示,代码如下:
<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="760" height="411" border="0" id="pdf"> 
<param name="_Version" value="65539"> 
<param name="_ExtentX" value="20108"> 
<param name="_ExtentY" value="10866"> 
<param name="_StockProps" value="0"> 
<param name="SRC" value="mm.pdf">
</object>,如果value指定路径的话,可以正常显示,但是 我想动态的给value赋值 页面中我这样写:<param name="SRC" value="<%# GetPdfAddress() %>">,这样写的话,无法正常的显示,为什么??求高手帮助,只想动态的给VALUE赋值

解决方案 »

  1.   

    pdf to flash:
    pdf文件用PDF2SWF转换成swf .然后用flexpaper加载  http://ufo-crackerx.blog.163.com/ASP.NET页面中显示PDF,word,excel等文档 
      

  2.   

    完美方案:http://www.radpdf.com/install/release-notes/orhttp://www.tallcomponents.com/pdfwebviewer1.aspx
      

  3.   

    pdf文件用PDF2SWF转换成swf .显示确实需要转换swf,       protected void Button1_Click(object sender, EventArgs e)
            {
                if (FileUpload1.HasFile)
                {
                    try{
                    string fileName = FileUpload1.FileName;
                    string fileExtention = FileUpload1.FileName.Substring(fileName.LastIndexOf(".") + 1);
                    string filePath = HttpContext.Current.Server.MapPath("~/TestSWF\\") + fileName;
                  
                    FileUpload1.SaveAs(filePath);
                    Page.ClientScript.RegisterStartupScript(this.GetType(),"","<script>alert('上传成功')</script>");
                        //切记,使用pdf2swf.exe 打开的文件名之间不能有空格,否则会失败
                    string cmdStr = HttpContext.Current.Server.MapPath("~/SWFTools/pdf2swf.exe");
                    string savePath = HttpContext.Current.Server.MapPath("~/TestSWF/");
                    string sourcePath=@""""+ savePath + fileName+@"""" ;
                        string targetPath=@""""+ savePath + fileName.Substring(0, fileName.LastIndexOf(".")) + ".swf"+@"""";
                        //@"""" 四个双引号得到一个双引号,如果你所存放的文件所在文件夹名有空格的话,要在文件名的路径前后加上双引号,才能够成功
                        // -t 源文件的路径
                       // -s 参数化(也就是为pdf2swf.exe 执行添加一些窗外的参数(可省略))
                    string argsStr = "  -t " +sourcePath+ " -s flashversion=9 -o " +targetPath;
                    ExcutedCmd(cmdStr,argsStr);                ListBox1.Items.Add(new ListItem(fileName.Substring(0, fileName.LastIndexOf(".")) + ".swf", fileName.Substring(0, fileName.LastIndexOf(".")) + ".swf"));
                    }
                    catch
                    {
                    
                    }
                }
            }        private static void ExcutedCmd(string cmd, string args)
            {
                using (Process p = new Process())
                {
                  
                    ProcessStartInfo psi = new ProcessStartInfo(cmd,args);
                    p.StartInfo = psi;
                    p.Start();
                    p.WaitForExit();
                }
            }        protected void Button2_Click1(object sender, EventArgs e)
            {
                Response.Redirect("~/Viewer.aspx?id="+HttpUtility.HtmlEncode(ListBox1.SelectedValue));
            }
      

  4.   

    还是看不懂,我这样说把,我把pdf文件的路径保存再数据库里,然后从数据库里读出地址,想在页面上显示pdf文件,用什么方法比较简单??。。