aspose file tools*
The moose likes XML and Related Technologies and the fly likes How to display an image while waiting for PDF to render? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to display an image while waiting for PDF to render?" Watch "How to display an image while waiting for PDF to render?" New topic
Author

How to display an image while waiting for PDF to render?

jay chris
Greenhorn

Joined: Feb 10, 2004
Posts: 3
Hi all, I would like to display an image (animated gif) to my user's when they wait (and wait and wait) for FOP to render my PDF. Does anybody have
a snippet of code that can do this? Currenty I open up a new window using javascript and the page name has a PDF extension.
Thanks
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
There's a more or less related article in the March 2004 issue of the JavaRanch Journal by Kyle Brown. Although in Kyle's article the long-running process is an SQL query, your problem seems to be pretty identical.
In short, start the FOP process in the background and direct the user's browser to a self-refreshing page which polls every two to three seconds whether the FOP process has finished generating the PDF file somewhere. If it has, display the PDF file. If it hasn't, display the self-refreshing page again.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
REad this thread as well, it has a definitive answer for your problem.


Spritle Software Blogs
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to display an image while waiting for PDF to render?