• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Printing a PDF without opening it

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 67449
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you mention client and server, is this a web application?
 
Master Rancher
Posts: 3921
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
dinesh chanchlani
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
    Bookmark Topic Watch Topic
  • New Topic