RFR: 8297191 : [macos] printing page range "page 2 to 2" or "page 2 to 4" on macOS leads to not print

Alexey Ivanov aivanov at openjdk.org
Thu Jun 20 18:43:12 UTC 2024


On Thu, 20 Jun 2024 11:10:59 GMT, Renjith Kannath Pariyangad <rkannathpari at openjdk.org> wrote:

>> src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java line 225:
>> 
>>> 223:             if (isRangeSet) {
>>> 224:                 attributes.add(new PageRanges(from+1, to+1));
>>> 225:                 attributes.add(SunPageSelection.RANGE);
>> 
>> why was this attribute added, and why is it being removed now? is the bug in SunPageSelection?
>
>> why was this attribute added, and why is it being removed now? is the bug in SunPageSelection?
> 
> I am not sure why this attribute added, but noticed for other OS's this workflow will be taken care by _RasterPrinterJob_ . With this attribute application pass through range and ended up in invalid page printing range.

This attribute is usually set, it should be set, I think.

The proposed changeset does resolve the problem where some pages are missing from printouts, but I cannot find a reasonable explanation as to why the problem goes away.

On the unmodified version, I tried adding traces into the printing code on macOS, the range of pages that's passed to the native code is correct, but the result is wrong number of pages pages printed if the first page is equal or greater than 2.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19740#discussion_r1647963800


More information about the client-libs-dev mailing list