On Wed, 6 Nov 2024 14:15:44 GMT, GennadiyKrivoshein <d...@openjdk.org> wrote:
> This update allows users to print with grayscale using color printers. > Actually, it is not possible to use the "Monochrome" option from the "Color > Appearance" panel. Also Chromaticity.MONOCHROME can't be used to print > grayscale on color printers > ([JDK-8315113](https://bugs.openjdk.org/browse/JDK-8315113)). > > **Fix description** > When a printer supports color printing and a user adds > Chromaticity.MONOCHROME attribute to a PrintRequestAttributeSet, then the > final printing raster is transformed to the grayscale color using > java.awt.image.ColorConvertOp. When the job is a PostScript job, then the > "setColor" and "setPaint" methods of the Graphics are overridden, and user > colors (paints) are transformed to the grayscale form using the new proxy > class GrayscaleProxyGraphics2D. > > This approach is assumed to be platform, CUPS, and IPP protocol independent. > > **Tests** > The fix was tested on Ubuntu 22.04 and MacOS 12.6.1. This pull request has now been integrated. Changeset: 8e51ff70 Author: Gennadiy Krivoshein <gennadiy.krivosh...@bell-sw.com> Committer: Phil Race <p...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/8e51ff70d896aeb5b35e6bb6b00f1818d67c99e7 Stats: 505 lines in 4 files changed: 501 ins; 0 del; 4 mod 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS Reviewed-by: prr, psadhukhan ------------- PR: https://git.openjdk.org/jdk/pull/21930