Package javax.print.attribute.standard

Examples of javax.print.attribute.standard.PrinterName


    PrintServiceAttributeSet printServiceAttributeSet =
      new HashPrintServiceAttributeSet();
    // Linux: print queues like "draft", "normal", "photo", etc
    // Windows: use physical printername like  "Epson Stylus COLOR 680" or "HP LaserJet 5000 Series PCL"
    PrinterName printerName = new PrinterName("normal", Locale.getDefault());
    printServiceAttributeSet.add(printerName);

    JRPrintServiceExporter exporter = new JRPrintServiceExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(
View Full Code Here


      String printerNameTemp = Configuration.getDecodedProperty("report.cardreport.printer", Constants.REPORT_CARDREPORT_PRINTER);

      if (printerNameTemp.equals("")) {
      } else {
        PrinterName printerName = new PrinterName(printerNameTemp, Locale.getDefault());
        printServiceAttributeSet.add(printerName);
      }

      JRPrintServiceExporter exporter = new JRPrintServiceExporter();
      exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
View Full Code Here

          "report.envelopreport.printer",
          Constants.REPORT_ENVELOPREPORT_PRINTER);

      if (printerNameTemp.equals("")) {
      } else {
        PrinterName printerName =
          new PrinterName(printerNameTemp, Locale.getDefault());
        printServiceAttributeSet.add(printerName);
      }

      JRPrintServiceExporter exporter = new JRPrintServiceExporter();
      exporter.setParameter(
View Full Code Here

            // lookup the print service for the supplied printer name
            String printerName = (String) serviceContext.remove("printerName");
            if (UtilValidate.isNotEmpty(printerName)) {

                PrintServiceAttributeSet printServiceAttributes = new HashPrintServiceAttributeSet();
                printServiceAttributes.add(new PrinterName(printerName, locale));

                PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, printServiceAttributes);
                if (printServices.length > 0) {
                    printer = printServices[0];
                    Debug.logInfo("Using printer: " + printer.getName(), module);
View Full Code Here

    tt.addColumn("Printer ID", String.class);
    tt.addColumn("Printer Name", String.class);
    for (int i = 0; i < services.length; i++)
    {
      final PrintService service = services[i];
      final PrinterName displayName = service.getAttribute(PrinterName.class);
      if (displayName != null)
      {
        tt.addRow(new Object[]{service.getName(), displayName.getValue()});
      }
      else
      {
        tt.addRow(new Object[]{service.getName(), service.getName()});
      }
View Full Code Here

     * @see org.apache.harmony.x.print.PrintClient#getAttributes()
     */
    public PrintServiceAttributeSet getAttributes() {
        PrintServiceAttributeSet attributes =
            new HashPrintServiceAttributeSet();
        attributes.add(new PrinterName(serviceName, Locale.getDefault()));
        if (getColorSupported(serviceName)) {
            attributes.add(ColorSupported.SUPPORTED);
            int colorPPM = getPagesPerMinuteColor(serviceName);
            if (colorPPM > 0) {
                attributes.add(new PagesPerMinuteColor(colorPPM));
View Full Code Here

            // lookup the print service for the supplied printer name
            String printerName = (String) serviceContext.remove("printerName");
            if (UtilValidate.isNotEmpty(printerName)) {

                PrintServiceAttributeSet printServiceAttributes = new HashPrintServiceAttributeSet();
                printServiceAttributes.add(new PrinterName(printerName, locale));

                PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, printServiceAttributes);
                if (printServices.length > 0) {
                    printer = printServices[0];
                    Debug.logInfo("Using printer: " + printer.getName(), module);
View Full Code Here

          PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
          printRequestAttributeSet.add(new Copies(mod.getPrintCopies()));


          PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet();
          printServiceAttributeSet.add(new PrinterName(JPrint.getPrinterServicebyName(printQueue).getName(), Locale.getDefault()));

          SimplePrintServiceExporterConfiguration configuration = new SimplePrintServiceExporterConfiguration();
          configuration.setPrintRequestAttributeSet(printRequestAttributeSet);
          configuration.setPrintServiceAttributeSet(printServiceAttributeSet);
          configuration.setDisplayPageDialog(false);
View Full Code Here

        else
        {
          exporter = new JRPrintServiceExporter();
          exporter.setParameter(JRPrintServiceExporterParameter.JASPER_PRINT, jasperPrint);
          serviceAttributeSet = new HashPrintServiceAttributeSet();
          serviceAttributeSet.add(new PrinterName(JPrint.getPrinterShortName(JPrint.getPreferredPrinterQueueName()), null));
          exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, serviceAttributeSet);
          exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE);
          exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, mod.isPrintDialog());
          PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
          printRequestAttributeSet.add(new Copies(mod.getPrintCopies()));
View Full Code Here

         * (by name) then we can save time by getting just that service
         * to check against the rest of the specified attributes.
         */
        PrintService[] services = null;
        if (serviceSet != null && serviceSet.get(PrinterName.class) != null) {
            PrinterName name = (PrinterName)serviceSet.get(PrinterName.class);
            PrintService service = getPrintServiceByName(name.getValue());
            if (service == null || !matchingService(service, serviceSet)) {
                services = new PrintService[0];
            } else {
                services = new PrintService[1];
                services[0] = service;
View Full Code Here

TOP

Related Classes of javax.print.attribute.standard.PrinterName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.