Package javax.print

Examples of javax.print.SimpleDoc


            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


                aset.add(OrientationRequested.PORTRAIT);
                aset.add(new JobName(AppLocal.APP_NAME + " - Document", null));
                aset.add(media);

                DocPrintJob printjob = ps.createPrintJob();
                Doc doc = new SimpleDoc(new PrintableBasicTicket(m_ticketcurrent, imageable_x, imageable_y, imageable_width, imageable_height), DocFlavor.SERVICE_FORMATTED.PRINTABLE, null);

                printjob.print(doc, aset);
            }

        } catch (PrintException ex) {
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

            // 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

            @Override
            public void onOkAnsware() {
                try {
                    DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                    PrintService service = PrintServiceLookup.lookupDefaultPrintService();
                    Doc simple_doc = new SimpleDoc(makeAccountsInputStreamPrinting(), flavor, null);
                    DocPrintJob job = service.createPrintJob();
                    job.print(simple_doc, null);
                } catch (Exception exc) {
                    showWarningPrint(exc);
                }
View Full Code Here

            @Override
            public void onOk() {
                try {
                    DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                    PrintService service = PrintServiceLookup.lookupDefaultPrintService();
                    Doc simple_doc = new SimpleDoc(makeAccountsInputStreamPrinting(), flavor, null);
                    DocPrintJob job = service.createPrintJob();
                    job.print(simple_doc, null);
                } catch (Exception exc) {
                    showWarningPrint(exc);
                }
View Full Code Here

      {
        PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
        pras.add(new Copies(1));

        FileInputStream fis = new FileInputStream(filename);
        v_doc = new SimpleDoc(fis, v_flavor, das);
        v_job.print(v_doc, pras);
        logger.debug("Submitting file to spooler : " + filename);
        fis.close();

        JFileIO deleteFile = new JFileIO();
View Full Code Here

                     * InputStream of client with OutputStream of
                     * StreamPrintSrevice - constructing DocFlavor for
                     * StreamPrintSrevice output - creating new SimpleDoc
                     * for client
                     */
                    clientDoc = new SimpleDoc(clientInputStream, newFlavor,
                            userDoc.getAttributes());

                    PrintJobThread printThread = new PrintJobThread(this,
                            userDoc, printRequestAS, sps);
                    printThread.start();
View Full Code Here

                        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

                     * InputStream of client with OutputStream of
                     * StreamPrintSrevice - constructing DocFlavor for
                     * StreamPrintSrevice output - creating new SimpleDoc
                     * for client
                     */
                    clientDoc = new SimpleDoc(clientInputStream, newFlavor,
                            userDoc.getAttributes());

                    PrintJobThread printThread = new PrintJobThread(this,
                            userDoc, printRequestAS, sps);
                    printThread.start();
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.