DocPrintJob object. Whether you are
sending print data to a stream or to a printer, you create a print
job in the same way: by calling createPrintJob on the service:
DocPrintJob pj = pservices[0].createPrintJob();An application obtains a print job from a service because the service only creates print jobs that are capable of handling data that the particular service can accept.
The DocPrintJob
interface provides the print method, which takes a
PrintRequestAttributeSet parameter and a Doc encapsulating the
print data and the DocFlavor:
pj.print(doc, aset);The next section discusses creating a
Doc.