use of sun.print.PageableDoc in project jdk8u_jdk by JetBrains.
the class RasterPrinterJob method spoolToService.
/*
* Services we don't recognize as built-in services can't be
* implemented as subclasses of PrinterJob, therefore we create
* a DocPrintJob from their service and pass a Doc representing
* the application's printjob
*/
// MacOSX - made protected so subclasses can reference it.
protected void spoolToService(PrintService psvc, PrintRequestAttributeSet attributes) throws PrinterException {
if (psvc == null) {
throw new PrinterException("No print service found.");
}
DocPrintJob job = psvc.createPrintJob();
Doc doc = new PageableDoc(getPageable());
if (attributes == null) {
attributes = new HashPrintRequestAttributeSet();
}
try {
job.print(doc, attributes);
} catch (PrintException e) {
throw new PrinterException(e.toString());
}
}
Aggregations