Examples of HashPrintRequestAttributeSet


Examples of javax.print.attribute.HashPrintRequestAttributeSet

      (PrintRequestAttributeSet attributes,
       final MasterReport report)
  {
    if (attributes == null)
    {
      attributes = new HashPrintRequestAttributeSet();
    }

    // for now, be lazy, assume that the first page is the reference
    final PageDefinition pdef = report.getPageDefinition();
    final PageFormat format = pdef.getPageFormat(0);
View Full Code Here

Examples of javax.print.attribute.HashPrintRequestAttributeSet

      (PrintRequestAttributeSet attributes,
       final MasterReport report)
  {
    if (attributes == null)
    {
      attributes = new HashPrintRequestAttributeSet();
    }

    if (attributes.containsKey(JobName.class) == false)
    {
      final String jobName = report.getReportConfiguration().getConfigProperty
View Full Code Here

Examples of javax.print.attribute.HashPrintRequestAttributeSet

      }

      PrintRequestAttributeSet printRequestAttributeSet = null;
      if(displayPrintDialogOnlyOnce || displayPageDialogOnlyOnce)
      {
        printRequestAttributeSet = new HashPrintRequestAttributeSet();
        setDefaultPrintRequestAttributeSet(printRequestAttributeSet);
        setOrientation((JasperPrint)jasperPrintList.get(0), printRequestAttributeSet);
        if(displayPageDialogOnlyOnce)
        {
          if(printerJob.pageDialog(printRequestAttributeSet) == null)
          {
            return;
          }
          else
          {
            displayPageDialog = false;
          }
        }
        if(displayPrintDialogOnlyOnce)
        {
          if(!printerJob.printDialog(printRequestAttributeSet))
          {
            printStatus = new Boolean[]{Boolean.FALSE};
            return;
          }
          else
          {
            displayPrintDialog = false;
          }
        }
      }
     
      List status = new ArrayList();
      // fix for bug ID artf1455 from jasperforge.org bug database
      for(reportIndex = 0; reportIndex < jasperPrintList.size(); reportIndex++)
      {
        setJasperPrint((JasperPrint)jasperPrintList.get(reportIndex));

        exporter = new JRGraphics2DExporter();
        exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        exporter.setParameter(JRExporterParameter.PROGRESS_MONITOR, parameters.get(JRExporterParameter.PROGRESS_MONITOR));
        exporter.setParameter(JRExporterParameter.OFFSET_X, parameters.get(JRExporterParameter.OFFSET_X));
        exporter.setParameter(JRExporterParameter.OFFSET_Y, parameters.get(JRExporterParameter.OFFSET_Y));
        exporter.setParameter(JRGraphics2DExporterParameter.ZOOM_RATIO, parameters.get(JRGraphics2DExporterParameter.ZOOM_RATIO));
        exporter.setParameter(JRExporterParameter.CLASS_LOADER, classLoader);
        exporter.setParameter(JRExporterParameter.URL_HANDLER_FACTORY, urlHandlerFactory);
        exporter.setParameter(JRExporterParameter.FILE_RESOLVER, fileResolver);
        if (parameters.containsKey(JRExporterParameter.FILTER))
        {
          exporter.setParameter(JRExporterParameter.FILTER, filter);
        }
        exporter.setParameter(JRGraphics2DExporterParameter.MINIMIZE_PRINTER_JOB_SIZE, parameters.get(JRGraphics2DExporterParameter.MINIMIZE_PRINTER_JOB_SIZE));
       
        if(displayPrintDialog || displayPageDialog ||
            (!displayPrintDialogOnlyOnce && !displayPageDialogOnlyOnce))
        {
          printRequestAttributeSet = new HashPrintRequestAttributeSet();
          setDefaultPrintRequestAttributeSet(printRequestAttributeSet);
          setOrientation(jasperPrint, printRequestAttributeSet);
        }
   
        try
View Full Code Here

Examples of javax.print.attribute.HashPrintRequestAttributeSet

      // Background this, as it takes a while.
      new Thread() {
        public void run() {
          try {
            PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
            pras.add(new JobName(entry.getCiteKey(), null));
            previewPane.print(null, null, true, null, pras, false);

          } catch (PrinterException e) {

            // Inform the user... we don't know what to do.
View Full Code Here

Examples of javax.print.attribute.HashPrintRequestAttributeSet

   *
   */
  public void print() throws JRException
  {
    long start = System.currentTimeMillis();
    PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
    printRequestAttributeSet.add(MediaSizeName.ISO_A4);

    PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet();
    //printServiceAttributeSet.add(new PrinterName("Epson Stylus 820 ESC/P 2", null));
    //printServiceAttributeSet.add(new PrinterName("hp LaserJet 1320 PCL 6", null));
    //printServiceAttributeSet.add(new PrinterName("PDFCreator", null));
View Full Code Here

Examples of javax.print.attribute.HashPrintRequestAttributeSet

        PrinterJob printJob = PrinterJob.getPrinterJob();

        printJob.setPrintable(new GanttPrintable(image,
                GanttPrintable.REDUCE_FACTOR_DEFAULT));

        PrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();
        attr.add(MediaSizeName.ISO_A4);
        attr.add(OrientationRequested.LANDSCAPE);

        if (printJob.printDialog(attr)) {
            try {
                printJob.print(attr);
            } catch (Exception e) {
View Full Code Here

Examples of javax.print.attribute.HashPrintRequestAttributeSet

    private void print() {
        PrinterJob prnJob = PrinterJob.getPrinterJob();
        prnJob.setPrintable(myPrintable);
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

        PrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();
        attr.add(myMediaSizeName);
        attr.add(myOrientation == PageFormat.LANDSCAPE ?
               OrientationRequested.LANDSCAPE :
                   OrientationRequested.PORTRAIT);
        Document doc = myProject.getDocument();
        if (doc != null)
            attr.add(new JobName(doc.getDescription(), language.getLocale()));

        if (prnJob.printDialog(attr)) {
            try {
                prnJob.print(attr);
                setVisible(false);
View Full Code Here

Examples of javax.print.attribute.HashPrintRequestAttributeSet

            final DocFlavor messageFormat = DocFlavor.SERVICE_FORMATTED.PRINTABLE;

            // bring up a dialog.
            PrintService[] services = PrintServiceLookup.lookupPrintServices(messageFormat, null);

            PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
            PrintService service =  ServiceUI.printDialog(null, 50, 50,
                                                          services,
                                                          PrintServiceLookup.lookupDefaultPrintService(),
                                                          messageFormat,
                                                          attributes);
View Full Code Here

Examples of javax.print.attribute.HashPrintRequestAttributeSet

      return;
    }

    // For print attributes see API docs: j2sdk-1_4_2/docs/api/index.html
    PrintRequestAttributeSet printRequestAttributeSet =
      new HashPrintRequestAttributeSet();
    printRequestAttributeSet.add(OrientationRequested.LANDSCAPE);
//    printRequestAttributeSet.add(OrientationRequested.PORTRAIT);
    printRequestAttributeSet.add(MediaSizeName.ISO_A4);

    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"
View Full Code Here

Examples of javax.print.attribute.HashPrintRequestAttributeSet

    try {
      JasperPrint jasperPrint = JasperFillManager.fillReport(jasperFileName, reportMap, new JREmptyDataSource());
     
      // For print attributes see API docs: j2sdk-1_4_2/docs/api/index.html
      PrintRequestAttributeSet printRequestAttributeSet =
        new HashPrintRequestAttributeSet();
      printRequestAttributeSet.add(OrientationRequested.PORTRAIT);
      printRequestAttributeSet.add(MediaSizeName.ISO_A4);

      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"
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.