Printing images fetched from remote server.

Posted by Nagababu under JavaScript on 9/20/2011 | Points: 10 | Views : 1560 | Status : [Member] | Replies : 0
Hi All,

I'm creating a Document Viewer. The viewer shows only one image page at a time. But when I click print the viewer should print all the images.
I have achieved this functionality by loading a pop window with all images and then calling window.print()

By the end user doesn't want to see the pop up. So I have created Image elements dynamically updating their source and then adding them to the body. After that I'm calling window.print(). While this code works fine in ie, it is not working as expected in firefox. While ie is waiting for the images to load and then print FireFox is not waiting and is printing the contents of alt attribute if images are not loaded. Can anyone suggest a work around.

1. We don't know the number of the images before hand so we cannot have html tags and have to rely on creating img elements dynamically
2. The Images are very huge and are fetched from a webservice so they take considerable time to load.
3. Cannot hardcode a delay because the time to load all the images depends on the network speed and number of images.



(No response found.)

Login to post response