View RSS Feed

Java AWT

Document Type Specification

Rate this Entry
by , 03-07-2012 at 05:41 PM (679 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);

Submit "Document Type Specification" to Facebook Submit "Document Type Specification" to Digg Submit "Document Type Specification" to del.icio.us Submit "Document Type Specification" to StumbleUpon Submit "Document Type Specification" to Google

Comments