On Wed, 19 Nov 2025 17:20:18 GMT, Alexey Ivanov <[email protected]> wrote:

> > Now, only the `CPrinterJob.javaPrinterJobToNSPrintInfo()` is responsible 
> > for passing of `PageRange` to macOS. The `PrinterView.knowsPageRanges()` 
> > just returns the number of available pages.
> 
> Can we do it the opposite way? This is what I'm asking about.
>
> Report the correct page range to macOS (as it's used to be done) but stop 
> applying this range again on the Java side.

Hm, I'm afraid I don't really understand what you're trying to achieve. The 
error occurred because the wrong number of pages was passed to macOS. This now 
fixed and done in the ``knowsPageRanges()`` method, which is the API defined by 
the macOS.

For the case that a Swing print dialog, a custom dialog or no dialog at all is 
used, Java defines an API for printing particular pages: the ``PageRanges`` 
class. This information is passed to macOS via ``NSPrintInfo``, which is filled 
in ``CPrinterJob.javaPrinterJobToNSPrintInfo()`` including the intended page 
range.

I don't see how it could be done in the opposite way.

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

PR Comment: https://git.openjdk.org/jdk/pull/11266#issuecomment-3559220600

Reply via email to