RFR: 8311033: [macos] PrinterJob does not take into account Sides attribute [v3]

Alexander Scherbatiy alexsch at openjdk.org
Fri Jul 14 14:50:12 UTC 2023


On Fri, 14 Jul 2023 14:44:57 GMT, Alexander Scherbatiy <alexsch at openjdk.org> wrote:

>> To reproduce the issue run the [JavaSidesAttributePrinting](https://bugs.openjdk.org/secure/attachment/104448/JavaSidesAttributePrinting.java) java sample with ONE_SIDED and DUPLEX arguments on macOS:
>> 
>> java JavaSidesAttributePrinting ONE_SIDED
>> java JavaSidesAttributePrinting DUPLEX
>> 
>> 
>> The sample calls PrinterJob print method with the given sides attribute.
>> The pages are printed according to the printer default settings not according to the provided Sides attributes.
>> 
>> The fix propagates Sides attribute
>> - from `PrinterJob` to `NSPrintInfo` in `CPrinterJob.javaPrinterJobToNSPrintInfo` method
>> - from `NSPrintInfo` to `PrinterJob` in `CPrinterJob.nsPrintInfoToJavaPrinterJob` method
>
> Alexander Scherbatiy has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Local supportedSides variable is used insted of supportedSides field

The test is updated to check the supported sides attributes. The test automatically passes if the number of supported attributes is equal or less than one.
A simple explanation is added which describes what needs to be printed when one sided, duplex, or tumble attribute is used.

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

PR Comment: https://git.openjdk.org/jdk/pull/14727#issuecomment-1635972111



More information about the client-libs-dev mailing list