views:

2996

answers:

3
+1  A: 

I wonder if you actually need to wait before printing -- won't the print job handle that for you? And I truly hope no modern browser will allow you (or any website for that matter) to print without that confirmation dialog (some old browsers used to do that, a long time ago).

Arjan
Hi Arjan,Thanks for your quick reply. If I call .print method before PDF file is loaded i get a Javascript error something like 'this method is not allowed for this object' (I get the error message in spanish).On your second apreciation I think that PDF is not printed by browser is printed by Acrobat plug-in :-)
SourceRebels
But that plugin could be present in anybody's browser, right? If so, then I don't expect that confirmation to disappear. Does the onload event for the body element fire before your PDF is loaded?
Arjan
Oh, it seems to me that Internet Explorer supports onload() for embed as well: http://msdn.microsoft.com/en-us/library/cc197055(VS.85).aspx
Arjan
@Arjan: Its a corporate Intranet application, all clients have Acrobat reader version 9 installed and Internet Explorer 7 :-), yes, the onload is fired before PDF is loaded and onload event of embed its having same behaviour.
SourceRebels
Hmmm, that's odd, the onload firing too early. Let's assume you'll have more luck finding that ActiveX control then...
Arjan
Thanks Arjan. We are using a kiosk-like OS and the solution for this issue is provided by this software. Thanks for your reply
SourceRebels
+3  A: 

You are not going to be able to print silently with plain old JavaScript. How would you like your printer to start printing out 100000000 pages of all black. Not a good thing. If you want to print silently and have it work for Internet Explorer only, there are ActiveX controls out there that can do it. This requires higher security settings for your page and for your users to really trust your site.

epascarello
Thanks, its for corporate intranet not for the Internet, they must trust! :-) Can you point me to this ActiveX. I will evaluate it.
SourceRebels
A: 

I know it is late, but I am trying to solve similar problem. Can you please reveal what your solution was if you found it? In my case, I want to know how long to wait before the PDF is completely downloaded so I can print it. I am not concerned about the silent print though. Thanks,

Milind
Finally our web runs in a kiosk-like environment, this functionality was included in this software :-) I'm sorry at the end not doing this from regular javascript.
SourceRebels