java.awt.print and javax.print, difference

H

hiwa

My past experience in Java printing is quite thin.
If I were to design and implement a general purpose desktop printing
utility application, which is better to be taken on between
java.awt.print package and javax.print package?

In view of performance, resource(memory, time, ...) cost, functional
versatility and ease of programming and debugging, what are the
essential difference between the two?

Greatly appreciate valuable opinions and remarks from Java printing
gurus. Thanks in advance.
 
T

Thomas Weidenfeller

hiwa said:
My past experience in Java printing is quite thin.

You are a lucky guy.
If I were to design and implement a general purpose desktop printing
utility application, which is better to be taken on between
java.awt.print package and javax.print package?

Both suck. javax.print sucks a little bit less. Not because the API
makes more sense, but because you get better access to the printer's
features and supported document formats (DocFlavors) - if your VM
implementation cooperates nicely with your OS.

In reality you might have a need for both packets. E.g.
java.awt.print.PrinterJob.pageDialog(...) now has a version which takes
a javax.print.PrintRequestAttributeSet for initialization. You could of
course role your own dialog instead.
In view of performance, resource(memory, time, ...) cost, functional
versatility and ease of programming and debugging, what are the
essential difference between the two?

Both suck. java.awt.print is extremely limited. So I don't think the
driving force will be anything like resources, but getting it to work at
all in a reasonable way.

Regarding debugging: Instead of using a real printer in the beginning
configure everything for printing PostScript to a file, and get a
PostScript viewer like ghostview for ghostscript. You will not only save
a few dead trees, but also save some time.

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top