File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My littel print function works in IE but not Mozilla any ideas ?

 
Frank Jacobsen
Ranch Hand
Posts: 358
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this function that print a image, works fine in IE 8.0, its shows the image in a new window and i can print the image.

But when i use Mozilla FireFox 3.6 i can see the image in my in a new window, but its only prints "About:blank"




Frank
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code is 100% untested. I think this will work better. Fist you preload the image, than you create an iframe, you print the iframe, and than you remove it.



Eric
 
Frank Jacobsen
Ranch Hand
Posts: 358
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, i tried to copy paste this in to my page, and the script runs fine, but nothing happens in IE and Mozilla, then i used the old fasion way
puts a lot off alerts into the kode, if i could find a bug somewhere, but all the javascript executes ....
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well with your code, you need to wait until the image is fully loaded. You can do that by just using a timeout and waiting a a second before calling print.

Eric
 
Frank Jacobsen
Ranch Hand
Posts: 358
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just want to add the solution i used, maybe someone else can use this, i works in IE and FireFox




Nice always to get quick respond in this forum

// Frank
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic