Specifies, for jobs using these attributes, the ranges of pages to be
printed, if a range of pages is to be printed. All range numbers are
inclusive. If this attribute is not specified, then the values from the
fromPage and toPages attributes are used. If pageRanges and either or
both of fromPage and toPage are specified, pageRanges takes precedence.
Specifying none of pageRanges, fromPage, or toPage is equivalent to
calling setPageRanges(new int[][] { new int[] {
minPage,
minPage } });
Parameters:
-
pageRanges - an array of integer arrays of 2 elements. An array
is interpreted as a range spanning all pages including and
between the specified pages. Ranges must be in ascending
order and must not overlap. Specified page numbers cannot be
less than
minPage nor greater than
maxPage.
For example:
(new int[][] { new int[] { 1, 3 }, new int[] { 5, 5 },
new int[] { 15, 19 } }),
specifies pages 1, 2, 3, 5, 15, 16, 17, 18, and 19. Note that
(new int[][] { new int[] { 1, 1 }, new int[] { 1, 2 } }),
is an invalid set of page ranges because the two ranges
overlap.
Throws:
-
IllegalArgumentException - if one or more of the above
conditions is violated.