This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Printing in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Printing in Java" Watch "Printing in Java" New topic

Printing in Java

Suman Mummaneni
Ranch Hand

Joined: Dec 14, 2004
Posts: 87
Hello guys,

I am working on Printing using Java API. Are there any standard dialogs like print dialog and UI which support print function in Java. Are there any standard api supporting pages setup,print preview,and print. Please busse me if there are any.

Pavan Panduga
Ranch Hand

Joined: Jun 12, 2002
Posts: 68
There is a whole javax.print package,

and here are some useful links
sun guide
javaworld article
some examples

Hope that Helps,
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
Personally I think the Java printing support is much like other parts of the language. Very flexible and powerful, but make the simple uses almost as hard as the complex uses. I'm just getting into some printing and will be using the JPS.

I really think there should be a good abstraction layer for pumping out basic printing that handles the paging and some basic layout, but I haven't found anything yet. Maybe that will be a good project for me to take on in another month or so. I've read the javaworld article and that may be a good place to start.
Suman Mummaneni
Ranch Hand

Joined: Dec 14, 2004
Posts: 87
Hi Pavan

Thanks for the reply. I need to know some thing else also
Are there any special API thta can processes data structures like the JTable before printing like converting them into a report fachion so that I can be readable.

Suman Mummaneni
Ranch Hand

Joined: Dec 14, 2004
Posts: 87
Hi Steven,

I you are right. I have read the Java world artical and I am currently working on JPS. The most hardest part of all is developing a print preview. Where you have to render various object data and fit them into the page formats. I am looking forward for Sun to develop some abstraction for JPS to do page formating. This will be cool, but for me I have to do it the old way.

I agree. Here's the link:
subject: Printing in Java
Similar Threads
Printing Question
Printing document
Print a document using java API
How to print different file formats (pdf, word, txt, img , xls...) in java ?
printing a microsoft word document file using java