6665212: PrinterJob class, method lookupStreamPrintServices(), "fos" in docs is unknown
Reviewed-by: tdv, prr
This commit is contained in:
parent
5d3228cbb3
commit
2f8d598ab1
@ -117,15 +117,18 @@ public abstract class PrinterJob {
|
||||
* FileOutputStream outstream;
|
||||
* StreamPrintService psPrinter;
|
||||
* String psMimeType = "application/postscript";
|
||||
* PrinterJob pj = PrinterJob.getPrinterJob();
|
||||
*
|
||||
* StreamPrintServiceFactory[] factories =
|
||||
* PrinterJob.lookupStreamPrintServices(psMimeType);
|
||||
* if (factories.length > 0) {
|
||||
* try {
|
||||
* outstream = new File("out.ps");
|
||||
* psPrinter = factories[0].getPrintService(fos);
|
||||
* psPrinter = factories[0].getPrintService(outstream);
|
||||
* // psPrinter can now be set as the service on a PrinterJob
|
||||
* } catch (FileNotFoundException e) {
|
||||
* pj.setPrintService(psPrinter)
|
||||
* } catch (Exception e) {
|
||||
* e.printStackTrace();
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
|
Loading…
x
Reference in New Issue
Block a user