Package javax.print

Examples of javax.print.Doc


                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


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

        if (psvc == null) {
            throw new PrinterException("No print service found.");
        }

        DocPrintJob job = psvc.createPrintJob();
        Doc doc = new PageableDoc(getPageable());
        if (attributes == null) {
            attributes = new HashPrintRequestAttributeSet();
        }
        try {
            job.print(doc, attributes);
View Full Code Here

        printClient = printService.getPrintClient();
        if (printService.isDocFlavorSupportedByClient(userDocDF)) {
            printClient.print(userDoc, printRequestAS);
        } else {
            try {
                Doc clientDoc = userDoc;
                PipedOutputStream spsOutStream = new PipedOutputStream();
                PipedInputStream clientInputStream = new PipedInputStream(
                        spsOutStream);

                DocFlavor newFlavor = null;
View Full Code Here

    /*
     * @see java.awt.print.PrinterJob#print()
     */
    public void print() throws PrinterException {
        Doc doc = null;
        if (psPrintable != null) {
            Pageable pageable = new Pageable() {
                public int getNumberOfPages() {
                    return UNKNOWN_NUMBER_OF_PAGES;
                }
View Full Code Here

        printClient = printService.getPrintClient();
        if (printService.isDocFlavorSupportedByClient(userDocDF)) {
            printClient.print(userDoc, printRequestAS);
        } else {
            try {
                Doc clientDoc = userDoc;
                PipedOutputStream spsOutStream = new PipedOutputStream();
                PipedInputStream clientInputStream = new PipedInputStream(
                        spsOutStream);

                DocFlavor newFlavor = null;
View Full Code Here

    /*
     * @see java.awt.print.PrinterJob#print()
     */
    public void print() throws PrinterException {
        Doc doc = null;
        if (psPrintable != null) {
            Pageable pageable = new Pageable() {
                public int getNumberOfPages() {
                    return UNKNOWN_NUMBER_OF_PAGES;
                }
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

TOP

Related Classes of javax.print.Doc

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.