Java 8 PrintException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 PrintException class.

This code example shows how to use the following methods:
    private Doc doc;
 
    public PrinterOperations() throws PrintException {        
        printService = PrintServiceLookup.lookupDefaultPrintService();
        if (printService == null) {
            throw new PrintException("Printer lookup failure. No default printer set up for this host");
        } 
        flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
        printRequestAttributeSet = new HashPrintRequestAttributeSet();
        printRequestAttributeSet.add(new Copies(1));
        printRequestAttributeSet.add(MediaSizeName.NA_LETTER);
        printRequestAttributeSet.add(Sides.ONE_SIDED);
    } 
 
    public PrinterOperations(PrintService printService, DocFlavor flavor, PrintRequestAttributeSet printRequestAttributeSet) throws PrintException {
        this.setPrintService(printService);
        this.setFlavor(flavor);
        this.setPrintRequestAttributeSet(printRequestAttributeSet);
    } 
 
5
CodeRank
This code example shows how to use the following methods:
    } 
    else 
    { 
      if (printService.isDocFlavorSupported(DocFlavor.SERVICE_FORMATTED.PAGEABLE) == false)
      { 
        throw new PrintException
            ("The print service implementation does not support the Pageable Flavor."); 
      } 
    } 
 
    PrintRequestAttributeSet attributes =
        Java14PrintUtil.copyConfiguration(null, report);
    attributes = Java14PrintUtil.copyAuxillaryAttributes(attributes, report);
 
    final PrintReportProcessor reportPane = new PrintReportProcessor(report);
    final DocPrintJob job = printService.createPrintJob();
    final SimpleDoc document = new SimpleDoc
        (reportPane, DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
 
    try 
4
CodeRank
See Code Examples for Java 8 PrintException Methods: