Examples of PageRanges


Examples of javax.print.attribute.standard.PageRanges

                            service.printerName, service.getPrinterProps()
                                            .getStructPtr());
            final AttributeSet docAttrs = doc.getAttributes();
            final Printable printable = castDoc(doc, Printable.class);
            final PageFormat format = getPageFormat(docAttrs, attributes);
            final PageRanges ranges = getAttribute(PageRanges.class, docAttrs,
                            attributes);
            int res = Printable.PAGE_EXISTS;

            try {
                startJob(pdc, getDocName(printable, docAttrs, attributes),
                                getDestinationPath(attributes));

                for (int i = 0; res == Printable.PAGE_EXISTS; i++) {
                    if ((ranges != null) && !ranges.contains(i)) {
                        continue;
                    }

                    res = printPrintable(printable, pdc, format, i);
                }
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

            final long pdc = WinPrinterFactory.getPrinterDC(
                            service.printerName, service.getPrinterProps()
                                            .getStructPtr());
            final AttributeSet docAttrs = doc.getAttributes();
            int pages = pageable.getNumberOfPages();
            final PageRanges ranges = getAttribute(PageRanges.class, docAttrs,
                            attributes);

            if (pages == Pageable.UNKNOWN_NUMBER_OF_PAGES) {
                pages = Integer.MAX_VALUE;
            }

            try {
                startJob(pdc, getDocName(pageable, docAttrs, attributes),
                                getDestinationPath(attributes));

                for (int i = 0; i < pages; i++) {
                    if ((ranges != null) && !ranges.contains(i)) {
                        continue;
                    }

                    final Printable printable = pageable.getPrintable(i);
                    final PageFormat format = null;
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

                    attrx.add(a);
                }
            }
        } else if (aname.equals("page-ranges-supported")) {
            for (int i = 0, ii = avalue.size(); i < ii; i++) {
                a = new PageRanges(((Integer) avalue.get(i)).intValue());
                if (a != null) {
                    attrx.add(a);
                }
            }
        } else if (aname.equals("number-up")
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

     * is always "All".
    */
    void fillPrintRangeFields() {
        if (firstUse) {
            if (attrs.containsKey(PageRanges.class)) {
                PageRanges aRange = (PageRanges) (attrs.get(PageRanges.class));
                int [][] range = aRange.getMembers();
                fromTxt.setText(range.length > 0
                        ? Integer.toString(range[0][0]) : "1");
                toTxt.setText(range.length > 0
                        ? Integer.toString(range[0][1]) : "1");
                pageRngBtn.setSelected(true);
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

                int fromValue = Integer.valueOf(fromTxt.getText()).intValue();
                int toValue = Integer.valueOf(toTxt.getText()).intValue();
                if (fromValue > toValue) {
                    throw new NumberFormatException();
                }
                newAttrs.add(new PageRanges(fromValue, toValue));
            } catch (NumberFormatException e) {
                return false;
            } catch (IllegalArgumentException e) {
                return false;           
            }
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

          {
            upper = lower;
            to_tf.setText("" + lower);
          }

        PageRanges range = new PageRanges(lower, upper);
        atts.add(range);
      }
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

          {
            from_tf.setEnabled(false);
            to.setEnabled(false);
            to_tf.setEnabled(false);

            atts.add(new PageRanges(1, Integer.MAX_VALUE));
          }
        else
          {
            from_tf.setEnabled(true);
            to.setEnabled(true);
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

                return OrientationRequested.LANDSCAPE;
            } else {
                return OrientationRequested.PORTRAIT;
            }
        } else if (category == PageRanges.class) {
            return new PageRanges(1, Integer.MAX_VALUE);
        } else if (category == Media.class) {
            MediaSizeName msn = findWin32Media(defPaper);
            if (msn != null) {
                 return msn;
             } else {
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

        } else if (category == PageRanges.class) {
            if (flavor == null ||
                flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) ||
                flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
                PageRanges []arr = new PageRanges[1];
                arr[0] = new PageRanges(1, Integer.MAX_VALUE);
                return arr;
            } else {
                return null;
            }
        } else if (category == PrinterResolution.class) {
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

            return new MediaPrintableArea(0.25f, 0.25f, iw, ih,
                                          MediaPrintableArea.INCH);
        } else if (category == OrientationRequested.class) {
            return OrientationRequested.PORTRAIT;
        } else if (category == PageRanges.class) {
            return new PageRanges(1, Integer.MAX_VALUE);
        } else if (category == RequestingUserName.class) {
            String userName = "";
            try {
              userName = System.getProperty("user.name", "");
            } catch (SecurityException se) {
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.