wood burning stoves 2.0*
The moose likes Java in General and the fly likes Printing a PDF without opening it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Printing a PDF without opening it" Watch "Printing a PDF without opening it" New topic
Author

Printing a PDF without opening it

dinesh chanchlani
Greenhorn

Joined: Jul 20, 2007
Posts: 6
Hi all,

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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60802
    
  65

Since you mention client and server, is this a web application?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
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.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41149
    
  45
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.


Ping & DNS - my free Android networking tools app
dinesh chanchlani
Greenhorn

Joined: Jul 20, 2007
Posts: 6
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?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41149
    
  45
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.
 
wood burning stoves
 
subject: Printing a PDF without opening it
 
Similar Threads
I want to print a document without opening it.
Is any way We can tell JSF to not response
iText Silent Print
Printing file without opening it
Printing PDF - Technical Solution Needed