Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What are the differences between the various printing APIs I see in the JDK?

0
10 Posted

What are the differences between the various printing APIs I see in the JDK?

0
10

A. These are the printing APIs in the JDK: 1.1 (aka AWT) printing – java.awt.PrintJob • A UI component-oriented printing API • Can print only the 1.1 “Graphics” API, not “Graphics2D” extensions 2D printing – java.awt.print.PrinterJob • A more flexible API for printing documents • Can print all of Java 2D. • Callback printing model • Integrates with javax.print Java Printing Service – javax.print packages • Adds discovery of printers and capabilities • Adds ability to specify job behaviour through attributes • Adds ability to install custom print services In summary 1.1/AWT printing can be used for many basic cases but has largely been superseded by 2D printing (as of J2SE 1.2), and when the javax.print package was added in J2SE 1.4 it was made largely complementary to 2D printing and integrated with it for ease of us. So most applications which are focused on rendering to a printer will find it more natural to centre around PrinterJob.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123