Search in sources :

Example 1 with PageableDoc

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());
    }
}
Also used : PrintException(javax.print.PrintException) Doc(javax.print.Doc) PageableDoc(sun.print.PageableDoc) PrinterException(java.awt.print.PrinterException) DocPrintJob(javax.print.DocPrintJob) PageableDoc(sun.print.PageableDoc) HashPrintRequestAttributeSet(javax.print.attribute.HashPrintRequestAttributeSet)

Aggregations

PrinterException (java.awt.print.PrinterException)1 Doc (javax.print.Doc)1 DocPrintJob (javax.print.DocPrintJob)1 PrintException (javax.print.PrintException)1 HashPrintRequestAttributeSet (javax.print.attribute.HashPrintRequestAttributeSet)1 PageableDoc (sun.print.PageableDoc)1