我在数据库中存入了大量的图片,然后用itext转成了pdf显示在页面上,但是这样显示的速度太慢了,后来看到百度文库感觉和我要实现的东西差不多,但是不知道怎么下手,那位高手帮忙解答一下啊 ? 谢谢!

解决方案 »

  1.   

    百度文库那样的带翻页的我做不到
    能做这样的。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 { }}
      

  2.   

    不是要这样的,这个我已经做出来了, 但是现在有两个问题,一个是 image-->pdf和pdf推到前台速度很慢,相当的慢。
      

  3.   

    [引自 ‘closewbq’]这需要有专门的控件去处理的。
    比如SOAOFFICE--微软office文档中间件,就可以将office文档直接在页面中打开。效果图
    http://www.kehansoft.com/soaoffice/doclist.asp  
    下载地址:http://www.kehansoft.com/web/down.htm 
      

  4.   

    http://www.docin.com/