File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes PDF download .. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "PDF download .." Watch "PDF download .." New topic

PDF download ..

Mufaddal Khumri

Joined: Jun 13, 2002
Posts: 9
I have a servlet that generates a PDF document and then sends it to the clients browser. If the client has a PDF plugin for his or her browser, the PDF document opens in the client's browser window, else the client gets a dialog box asking him to save the PDF document to his or her hard disk.
In my web application the client clicks a link which invokes a smaller child window for the PDF to be displayed in. The problem I am facing is that while the PDF is being generated, I need to show the client some kind of notification in this child browser window. How do I do this ?
I tried one approach that is i write the header information in my servlet and flush that, so that the client gets that information and starts displaying the PDF as its being genrated, but that did not work. The PDF gets generated sent and then only does it appear in the child window.
Any help on this will be appreciated.
Chris Baron
Ranch Hand

Joined: Mar 21, 2003
Posts: 1061
i'd try the following:
Load a plain html page into the popup first, wich contains the notification and a Javascript that calls the servlet.
Usually the old page stays in the browser, so the notification should be shown while the pdf is generated and sent back to the client.

No guarantee for this, you have to try
[ September 21, 2003: Message edited by: Chris Baron ]
I agree. Here's the link:
subject: PDF download ..
jQuery in Action, 3rd edition