aspose file tools*
The moose likes Java in General and the fly likes Printing a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Printing a file" Watch "Printing a file" New topic
Author

Printing a file

Gary Kephart
Greenhorn

Joined: Jul 29, 2003
Posts: 6
I have a Swing app from which I want the following to happen:
1) User selects a report
2) User selects a printer from a dialog box
3) I create either an HTML String or a temp HTML file
4) I send the above to the selected printer
I took a look at the java.awt.print and javax.print packages, but neither seem to do what I want. The javax.print looks close, but I don't see any place for a user to select a printer. Any ideas?
Thanks,
Gary
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1821

Look at the .printDialog() method of a java.awt.print.PrinterJob. That should be what you are looking for.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Printing a file