StreamPrintServiceFactory: lookupStreamPrintServiceFactories(DocFlavor flavor, String outputMimeType) : StreamPrintServiceFactory « javax.print « Java by API






StreamPrintServiceFactory: lookupStreamPrintServiceFactories(DocFlavor flavor, String outputMimeType)

  


import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;

import javax.print.StreamPrintService;
import javax.print.StreamPrintServiceFactory;

public class Main {
  public static void main(String[] argv) throws Exception {

    StreamPrintServiceFactory[] factories = StreamPrintServiceFactory
        .lookupStreamPrintServiceFactories(null, null);

    OutputStream fos = new BufferedOutputStream(new FileOutputStream("outfile.ps"));
    StreamPrintService service = factories[0].getPrintService(fos);

  }
}

   
    
  








Related examples in the same category

1.StreamPrintServiceFactory: getPrintService(OutputStream out)