Tutorial by Examples

To discovery all the available print services, we can use the PrintServiceLookup class. Let's see how: import javax.print.PrintService; import javax.print.PrintServiceLookup; public class DiscoveringAvailablePrintServices { public static void main(String[] args) { discoverPrintS...
To discovery the default print service, we can use the PrintServiceLookup class. Let's see how:: import javax.print.PrintService; import javax.print.PrintServiceLookup; public class DiscoveringDefaultPrintService { public static void main(String[] args) { discoverDefaultPrintSer...
A print job is a request of printing something in a specific print service. It consists, basically, by: the data that will be printed (see Building the Doc that will be printed) a set of attributes After picking-up the right print service instance, we can request the creation of a print job...
Doc is an interface and the Java Print Service API provide a simple implementation called SimpleDoc. Every Doc instance is basically made of two aspects: the print data content itself (an E-mail, an image, a document etc) the print data format, called DocFlavor (MIME type + Representation class...
Sometimes we need to determine some aspects of the print request. We will call them attribute. Are examples of print request attributes: amount of copies (1, 2 etc), orientation (portrait or landscape) chromacity (monochrome, color) quality (draft, normal, high) sides (one-sided, two-sided e...
For the most printing clients, is extremely useful to know if a print job has finished or failed. The Java Print Service API provide some functionalities to get informed about these scenarios. All we have to do is: provide an implementation for PrintJobListener interface and register this impl...

Page 1 of 1