-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
tiger
-
generic
-
generic
-
Verified
Pageable interface is implemented in such a way that it returns '0' when getNumberOfPages() is called. On Win32 platforms, the page ranges 'From', 'To' fields as well as the range radio button are disabled in the native print dialog on all the builds prior to JDK1.5.0-b05 (1.3.0, 1.4.0-b92, 1.4.2-b24, 1.5.0-b04). On JDK1.5.0-b05, 06 and in the PIT build, these fields are not disabled (range radio button also). As mentioned in bug 4869502, on the PIT build 'To page' value is not set and 'From page' value is set to 0 where as on tiger b05, b06 the 'From' and 'To' page values are set to 1.
On solaris, the 'From' and 'To' page values are always set to 1 in the cross-platform dialog regardless of the value returned by getNumberOfPages().
Though the page ranges fields are disabled, clicking 'OK' in the print dialog makes the PrinterJob call the printable methods infinitely until the print method of Printable returns NO_SUCH_PAGE value. It has been documented that this is the expected behaviour when getNumberOfPages() returns UNKNOWN_NUMBER_OF_PAGES (-1). But same behavior seem to occur for value '0' also. I am not quite sure whether this is a bug. If not, probably it can be documented. This is reproducible on all the builds right from JDK1.3.0.
This was tested on the following PIT build:
java version "2d-jcg-win-01-23-May-03.tiger"
Java(TM) 2 Runtime Environment, Standard Edition (build 2d-jcg-win-01-23-May-03.tiger)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b07, mixed mode)
How to reproduce:
Run the attached sample code. It implements pageable interface in such a way that getNumberOfPages() returns '0'. If you see the range option not being disabled in the native print dialog, the bug is reproduced. Choose 'PrintToFile'
option and click 'OK' in the print dialog. Enter a file name. You would notice in the console that the pageable methods are being called infinitely by the PrinterJob.
I tested this on Win NT, Win XP and Solaris 8 with Xerox DocuPrint N4025 printer.
On solaris, the 'From' and 'To' page values are always set to 1 in the cross-platform dialog regardless of the value returned by getNumberOfPages().
Though the page ranges fields are disabled, clicking 'OK' in the print dialog makes the PrinterJob call the printable methods infinitely until the print method of Printable returns NO_SUCH_PAGE value. It has been documented that this is the expected behaviour when getNumberOfPages() returns UNKNOWN_NUMBER_OF_PAGES (-1). But same behavior seem to occur for value '0' also. I am not quite sure whether this is a bug. If not, probably it can be documented. This is reproducible on all the builds right from JDK1.3.0.
This was tested on the following PIT build:
java version "2d-jcg-win-01-23-May-03.tiger"
Java(TM) 2 Runtime Environment, Standard Edition (build 2d-jcg-win-01-23-May-03.tiger)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b07, mixed mode)
How to reproduce:
Run the attached sample code. It implements pageable interface in such a way that getNumberOfPages() returns '0'. If you see the range option not being disabled in the native print dialog, the bug is reproduced. Choose 'PrintToFile'
option and click 'OK' in the print dialog. Enter a file name. You would notice in the console that the pageable methods are being called infinitely by the PrinterJob.
I tested this on Win NT, Win XP and Solaris 8 with Xerox DocuPrint N4025 printer.
- relates to
-
JDK-4885375 Page Ranges 'To Page' field must be populated based on Pageable
-
- Resolved
-
-
JDK-4869502 Page Ranges 'To page' field is not populated when pageable is used
-
- Closed
-