On Wed, 21 Jan 2026 07:26:38 GMT, Prasanta Sadhukhan <[email protected]>
wrote:
>> If same `PrinterJob `is reused to first print user-set `PageRange `pages and
>> then print ALL pages, it prints the first print job correctly as the page
>> range is set but 2nd job doesn't print ALL pages and reprint the same page
>> range as `from` and `to` page are not reset and reused
>>
>> Fix is made to check if page range is not set then print all pages
>
> Prasanta Sadhukhan has updated the pull request with a new target base due to
> a merge or a rebase. The pull request now contains four commits:
>
> - Merge master
> - Merge master
> - Remove PageRange attribute if range is not set
> - 8373239: Test java/awt/print/PrinterJob/PageRanges.java fails with
> incorrect selection of printed pages
src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java line 1737:
> 1735: setPageRange(from, to);
> 1736: } else {
> 1737: attributes.remove(PageRanges.class);
I'm a bit surprised you didn't need to still reset the page range ... is
something else re-setting it ?
setPageRange(Pageable.UNKNOWN_NUMBER_OF_PAGES, Pageable.UNKNOWN_NUMBER_OF_PAGES)
src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java line 1737:
> 1735: setPageRange(from, to);
> 1736: } else {
> 1737: attributes.remove(PageRanges.class);
I'm a bit surprised you didn't need to still reset the page range ... is
something else re-setting it ?
setPageRange(Pageable.UNKNOWN_NUMBER_OF_PAGES, Pageable.UNKNOWN_NUMBER_OF_PAGES)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29312#discussion_r2713845703
PR Review Comment: https://git.openjdk.org/jdk/pull/29312#discussion_r2713846544