wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Acrobat javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Acrobat javascript" Watch "Acrobat javascript" New topic
Author

Acrobat javascript

Zip Ped
Ranch Hand

Joined: Jul 26, 2005
Posts: 336
Hi,

I have a problem with printing pdf files coming from my server. I have to include a functionality such that when the user clicks on a print button on the page, the page is sent to the printer(user's printer) without going through the Print dialog. I am viewing the PDF in the browser.

I read an article on Acrobat JS and wanted to know whether its possible to include an init method in Acrobat Javascipt so that when the pdf opens, the print command is issued(javascript invocation) and the window is closed(javascript invocation). Thats one way i thought of avoiding the Print dialog.

Any suggestions, tutorials, articles or code samples on how to avoid print functionality wouldbe helpful.



Thanks,

Kailash
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If you were able to do this, you would be surfing the net and andom things would print. Not good! You can look into activeX, but an action will have to be taken by the user most likely.

Eric
Zip Ped
Ranch Hand

Joined: Jul 26, 2005
Posts: 336
Thanks for your response Eric. Unfortunately, I can't use ActiveX. There are or were a few bugs in IE because of which you could close browser windows without prompt and print without prompt. Thats not a good solution either. I am still looking for an alternative....
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
With what you just said, is a reason why you are not going to be able to acomplish this goal. Open up the window and let your users print the document and close it when they are done. There is no direct access to the printer. If you really need this, then you should probably look into a client application and not a web application. I always tell people to build the application around the browser, not the other way.

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
With what you just said, is a reason why you are not going to be able to acomplish this goal. Open up the window and let your users print the document and close it when they are done. There is no direct access to the printer. If you really need this, then you should probably look into a client application and not a web application. I always tell people to build the application around the browser, not the other way.

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
With what you just said, is a reason why you are not going to be able to acomplish this goal. Open up the window and let your users print the document and close it when they are done. There is no direct access to the printer. If you really need this, then you should probably look into a client application and not a web application. I always tell people to build the application around the browser, not the other way.

Eric
Zip Ped
Ranch Hand

Joined: Jul 26, 2005
Posts: 336
Hmmm...too many submits???

Well, first thing. This is a small part of the web application I am working on. I cant use a client application.

I found a way to print the pdf from server side java code. The same functionality can also be achieved by using applets. However I need to test them first.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Acrobat javascript