java.awt.print and javax.print, difference

Discussion in 'Java' started by hiwa, Mar 9, 2005.

  1. hiwa

    hiwa Guest

    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.
    hiwa, Mar 9, 2005
    #1
    1. Advertising

  2. hiwa wrote:
    > 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

    --
    The comp.lang.java.gui FAQ:
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
    Thomas Weidenfeller, Mar 9, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jochen Opp

    java.awt or javax.swing

    Jochen Opp, Sep 23, 2003, in forum: Java
    Replies:
    1
    Views:
    577
    Roedy Green
    Sep 23, 2003
  2. Robert Mark Bram
    Replies:
    2
    Views:
    5,942
    Robert Mark Bram
    Dec 11, 2003
  3. Replies:
    1
    Views:
    711
    Esmond Pitt
    Mar 27, 2005
  4. african brewer
    Replies:
    2
    Views:
    655
    markspace
    Aug 10, 2009
  5. steveh44
    Replies:
    12
    Views:
    747
    Daniele Futtorovic
    May 6, 2011
Loading...

Share This Page