Method1:Open pdf using pdf reader, such as Adobe Reader

Step1:页面contentType为text/html

<%@ page  contentType="text/html; charset=gbk"
 pageEncoding="UTF-8"%>

Step2:生成PDF文件路径

String filePath =" http://locast:8080/myproject/ext/temp/test.pdf";  

Step3:请求转发,访问PDF文件

if (filepath.endsWith(".pdf")) {
     response.setContentType("application/pdf");//很重要,不然直接打开pdf会乱码
     response.sendRedirect(filepath);
}


Method2:

Step1:PDF Convert To SWF

swftools official website:http://www.swftools.org/

下载后可以cmd调用命令
 C:\Program files\swftools>pdf2swf.exe c:\\1.pdf c:\\1.swf -s languagedir=c:\\xpdf\\chinese-simplified

后面languagedir是对编码进行处理,可以到官网:http://www.foolabs.com/xpdf/download.html这里去下载windows系统的xpdf,然后拷贝到c盘根目录下,然后下载语言包
  • Chinese/simplified: xpdf-chinese-simplified.tar.gz (907207 bytes)
  • 下载后,然后复制到xpdf下面,具体可以看路径分析 c:\\xpdf\\chinaese-simplified
Step2:Open swf using flexpaper control in jsp

FlexPaper Official Website:http://flexpaper.devaldi.com/default.jsp
download 里面有例子,好像需要部署到程序上才能看到,别下载下来打开。

相关文章:

  • 2021-12-20
  • 2022-03-02
  • 2021-10-22
  • 2022-12-23
  • 2021-10-21
  • 2021-07-19
  • 2022-12-23
  • 2021-10-29
猜你喜欢
  • 2021-10-16
  • 2022-01-23
  • 2022-03-09
  • 2021-08-14
  • 2021-12-15
  • 2022-12-23
  • 2021-08-01
相关资源
相似解决方案