Java定位打印(Java location printing)
Java定位打印(Java location printing)
Suddenly, such as spring night, thousands of pear trees. The fallen flower, in gloomy mood, Speechless blame dongfeng. Born in misery, died in peace. Learning without thought is labor lost, thought without learning is perilous. The sand in the desert is like snow, and the moon in Yanshan seems like a hook. Java positioning printing (such as: supermarket, bill printing)
Key words: Java
Java has been developing rapidly in every field since it came out, but printing has been the weakest aspect of Java all along. In fact, Java1.0 does not support any print function. Java1.1 contains a class called PrintJob in the java.awt package, but this class provides print functionality that is very coarse and unreliable. When java1.2 came out, it designed a fully independent printer system (called java2D printing API) around PrinterJob, and defined some new classes and interfaces in the java.awt.print package. These make PrintJob printer based (that is, AWT printing) basically obsolete, although PrintJob has never been attacked and, at least in this article, is still a technology providing class.
In J2SE1.3, when PrintJob's functionality was extended to make it possible to set some additional changes to the properties of the project and page by setting the two classes of JobAttributes and PageAttributes in the java.awt package. With the release of J2SE1.3, printing functions have been correspondingly improved; however, there are still some problems when mixing these two completely different printers. For example, the two mechanisms use an interface of the class java.awt.Graphics to display the print content, meaning that everything printed must be represented with a picture. In addition, the improved PrintJob provides very limited set of engineering related attributes; the two mechanisms have no way to select the target printer through the program.
The biggest change in Java printing comes from the Java print service API brought by J2SE1.4's release