Document Type Specification
by, 03-07-2012 at 05:41 PM (608 Views)
Format of the print data is presented by DocFlavor, like PostScript or JPEG. There are 2 main parts of the DocFlavor: A representation class name or a MIME type. MIME shows that what is the format and a document representation class name show the way documents are delivered to output stream/ printer. An attribute set and DocFlavor is used by an application to find printers with certain capabilities that have been specified by attribute set. Such sample code shows the way an array of StreamPrintServiceFactory object is obtained which may return the StreamPrintService objects, that are capable of converting GIF to PostScript.
Java Code:DocFlavor flavor = DocFlavor.INPUT_STREAM.GIF; String psMimeType = DocFlavor.BYTE_ARRAY.POSTSCRIPT.getMimeType(); StreamPrintServiceFactory psfactories = StreamPrintServiceFactory. lookupStreamPrintServiceFactories( flavor, psMimeType);