Hi everybody

I want to display pdf with servlet. To do this when i
call servlet then it says to download but it does not
display this.

To do this i have made the following servlet. pls
suggest me what should i do.



public void service(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException
{
  try
  {
    FDFTK FDFtk = new FDFTK();
    FDFtk.FDFTKInit();

    FDFDoc doc = new FDFDoc();
    doc.SetFile("http://localhost:8080/TIJ2.pdf";);
    byte[] data = doc.Save();
    doc.Close();

    FDFtk.FDFTKTerm();

    resp.setContentType("application/pdf");
    resp.setContentLength(bf.toString().length());
    resp.getOutputStream().print(bf.toString());

  }catch(FDFException e){}
}

Thanks

Sharad Mohan

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to