When you click on the button, after confirmation and printer selection, the button does a doPost to the servlet which then prints all the available reports.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Joined: Sep 04, 2005
Thanks for reply,
But I cannot find any solution over there. Actually I implemented some of the code sample that it has but of no use. Can you give me any code sample which will generate a pop-up for selection of printer and confirmation of user. This code is taking default service on network. About which servlet you were talikng I cannot find any one at the link mentioned by you.
Something will ALWAYS have to open the file or how would it know what to print?
Joined: Sep 04, 2005
Now I am able to select printer but not able to print contents of the file. Can anyone tell me how to print a file/report using java print api. I used all kind of DocFlavors but it did not work.
Also I want to print contents of report which is lying on defferent server for which I will have a link with me (URL). Can anybody tell me how to bring contents from that URL and write to a temporary file and then print out contents of this file without displaying it to user. Or is there any way to print the contents of that URL directly to printer without displaying it to user.
You should contact the people who gave you the requirement "print the document without opening that document" and let them explain what exactly they mean with this. What does "opening the document" mean to them? For example, is it a Word document, and by "without opening the document" do they mean that it should not open Microsoft Word?
In what format are your documents - HTML, PDF, DOC, ...?
Instead of giving such replies please prvovide me some solution. Java Print APIs are helpful for this and I'm using the same but the problem is DocFlavor that I used is not able to match with the printer's requirement.So I used DocFlavor (http://java.sun.com/j2se/1.5.0/docs/api/) as Printable but it did not work. Can anybody tell me is there any way to pick up files and put it into printer's printing queue? Is there any opensource in java available for this?