I have to silent print(without print dialogue box) a pdf file without opening it,how can this be done in java?Can itext help in this?Also if the pdf file is on the server,client is given a print button on the GUI,when button is clicked, i want the pdf to get silent printed on clients printer.How can this be achieved?Please help me on this.
If your client program can read the pdf file from the server and if it has the classes to decode/expand the contents of the pdf and if the client program can print, then that is how you would do it.
Part 1 would be a simple HTTP GET with some class or combos of classes like URL and openConnection and InputStream. Part 2 - might be a package that does that. Google for it. Part 3 - Probably would come with Part 2, otherwise write some printer code.
See this discussion for various points to consider. It's hard to advise without knowing what kind of client and server you're talking about.
Joined: Jul 20, 2007
Thanks for the response. Yes it is a web application.Ulf i have similar(link which you mentioned) requirement,as you have mentioned it is impossible to achieve that,does that mean the pdf file should be first saved on the clients machine and then client can print it as per his wish?
Joined: Mar 22, 2005
That's up the client. The browser may have been set to open PDFs, in which case printing is possible without explicitly saving it first.
But in general, don't presume to tell the user what to do with a file (open, save, print, delete, read, ignore, whatever). The user generally knows better than the developer what he wants to do with a file.