Package javax.print

Examples of javax.print.SimpleDoc


                        throws IndexOutOfBoundsException {
                    return psPrintable;
                }
            };
           
            doc = new SimpleDoc(pageable,
                    DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
        } else if (psDocument != null) {
            doc = new SimpleDoc(psDocument,
                    DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
        } else {
            throw new PrinterException("Neither Printable nor Pageable were " +
                    "specified.");
        }
View Full Code Here


    }

    @Override
    public void setPageable(final Pageable document)
                    throws NullPointerException {
        doc = new SimpleDoc(document, DocFlavor.SERVICE_FORMATTED.PAGEABLE,
                        null);
    }
View Full Code Here

    }

    @Override
    public void setPrintable(final Printable painter, final PageFormat format) {
        if (format != null) {
            doc = new SimpleDoc(new PrintableWrapper(painter, format),
                            DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
        } else {
            doc = new SimpleDoc(new PrintableWrapper(painter, this.format),
                            DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
        }
    }
View Full Code Here

      }

      DocPrintJob pj = service.createPrintJob();

      // BUGZILLA 24 http://www.willuhn.de/bugzilla/show_bug.cgi?id=24
      Doc doc = new SimpleDoc(iniletter.toString(),DOCFLAVOR,null);
      pj.print(doc,PRINTPROPS);
    }
    catch (Exception e)
    {
      Logger.error("error while printing ini letter",e);
View Full Code Here

  DocAttributeSet das = new HashDocAttributeSet();
    das.add(Chromaticity.MONOCHROME);

    Object payload = message.getPayload();

    final Doc doc = new SimpleDoc(message.getPayload(), docFlavor, das);

    final DocPrintJob job = this.printServiceExecutor.getPrintService().createPrintJob();

    PrintJobMonitor printJobMonitor = new PrintJobMonitor(job);
View Full Code Here

    private void doPrint(PrintService service, File toPrintFile) throws Exception {
        FileInputStream stream = null;
        try {
            stream = new FileInputStream(toPrintFile);
            DocFlavor format = DocFlavor.INPUT_STREAM.AUTOSENSE;
            Doc myDoc = new SimpleDoc(stream, format, null);
            PrintRequestAttributeSet aset = null;
            // new HashPrintRequestAttributeSet();
            // aset.add(new Copies(1));
            // aset.add(MediaSize.ISO.A4);
            // aset.add(Sides.ONE_SIDED);
View Full Code Here

    private void doPrint(PrintService service, File toPrintFile) throws Exception {
        FileInputStream stream = null;
        try {
            stream = new FileInputStream(toPrintFile);
            DocFlavor format = DocFlavor.INPUT_STREAM.AUTOSENSE;
            Doc myDoc = new SimpleDoc(stream, format, null);
            PrintRequestAttributeSet aset = null;
              // new HashPrintRequestAttributeSet();
            // aset.add(new Copies(1));
            // aset.add(MediaSize.ISO.A4);
            // aset.add(Sides.ONE_SIDED);
View Full Code Here

     
      // InputStream apontando para o conte�do a ser impresso
      FileInputStream fi = new FileInputStream("teste.txt");
     
      // Cria um Doc para impress�o a partir do arquivo exemplo.txt
      Doc textDocument = new SimpleDoc(fi, docFlavor, attributes);
     

      // Configura o conjunto de parametros para a impressora
      PrintRequestAttributeSet printerAttributes = new HashPrintRequestAttributeSet();
     
View Full Code Here

            // Print is sent
            DocFlavor psInFormat = new DocFlavor.INPUT_STREAM(printerContentType);
            InputStream bais = new ByteArrayInputStream(baos.toByteArray());
           
            Doc myDoc = new SimpleDoc(bais, psInFormat, null);
            PrintServiceAttributeSet psaset = new HashPrintServiceAttributeSet();
            if (UtilValidate.isNotEmpty(printerName)) {
                try {
                    URI printerUri = new URI(printerName);
                    PrinterURI printerUriObj = new PrinterURI(printerUri);
View Full Code Here

            throw new ViewHandlerException("Unable write to browser OutputStream", e);           
        }
        */                            
       
        DocFlavor docFlavor = DocFlavor.BYTE_ARRAY.PDF;
        Doc myDoc = new SimpleDoc(out.toByteArray(), docFlavor, null);
        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
        aset.add(new Copies(1));
        //aset.add(MediaSize.A4);
        aset.add(Sides.ONE_SIDED);
       
View Full Code Here

TOP

Related Classes of javax.print.SimpleDoc

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.