RFR: 8297191: [macos] Printing a page range with starting page > 1 results in missing pages [v3]
Alexey Ivanov
aivanov at openjdk.org
Thu Nov 20 19:10:10 UTC 2025
On Tue, 18 Nov 2025 15:01:14 GMT, Christian Heilmann <duke at openjdk.org> wrote:
>> This PR fixes a bug that caused no or the wrong set of pages to be printed when using page ranges on macOS.
>>
>> The main fix is to change the 'location' value of the returned NSRange from the knowsPageRange method to 1 in the native class PrinterView.m.
>
> Christian Heilmann has updated the pull request incrementally with three additional commits since the last revision:
>
> - Update PrinterView.m
> - Update PrinterView.h
> - Update CPrinterJob.m
Phil said and you agreed that the page range was applied twice. Do I understand it correctly?
Previously, we passed the correct range of pages to macOS via `knowsPageRanges()`, for example 2–4.
The proposed fix changes the code so that the range is pages isn't passed to macOS, or rather page 1 to number of pages.
Then when printing Java applies the requested page range.
Is it possible to pass the known page range to macOS and was done before the current PR? For example, to print pages 2–4, pass the start page 2 and the number of pages 3. (The number of pages to print is known even if a `Printable` interface doesn't return the number of pages.)
Then modify the printing code in Java so that it doesn't apply the page range again, but just prints the requested pages instead.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/11266#issuecomment-3559611904
More information about the client-libs-dev
mailing list