福昕阅读器
我知道绝对有这个选项,adobe的就不知道了。
实在没有的话
把PDF播放器卸载,装个福昕的,然后安装的时候注意别选上那个浏览器在线打开PDF的选项就行了……
jsp中要利用java来实现打开,可以通过浏览器打开:以下程序实现了读取某个路径下的pdf文件,并用浏览器打开:
package test
import java.io.File
import java.io.FileInputStream
import java.io.IOException
import java.io.OutputStream
import javax.servlet.ServletException
import javax.servlet.http.HttpServlet
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
public class PDFServlet extends HttpServlet {
private static final long serialVersionUID = -3065671125866266804L
public PDFServlet() {
super()
}
public void destroy() {
super.destroy()
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("application/pdf")
FileInputStream in = new FileInputStream(new File("d:/1.pdf"))
OutputStream out = response.getOutputStream()
byte[] b = new byte[512]
while ((in.read(b)) != -1) {
out.write(b)
}
out.flush()
in.close()
out.close()
}
public void init() throws ServletException {
}
}
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)