RFR: 8318023: Implement IPP output-bin attribute extension on macOS [v2]
Phil Race
prr at openjdk.org
Tue Oct 17 21:35:12 UTC 2023
On Thu, 12 Oct 2023 16:48:11 GMT, Alexander Scherbatiy <alexsch at openjdk.org> wrote:
>> The fix adds new public `OutputBin` print attribute class which allow to set a printer output bin in a `PrinterJob` class. The corresponding internal `CustomOutputBin` class is added as well.
>>
>> - Constants used in `OutputBin` class are based on [Internet Printing Protocol (IPP): “output-bin” attribute extension](https://ftp.pwg.org/pub/pwg/candidates/cs-ippoutputbin10-20010207-5100.2.pdf) document.
>> - `CUPSPrinter.getOutputBins(String printer)` method uses PPD `ppdFindOption(..., "OutputBin")` function to get supported output bins for the given printer on native level.
>> - The fix propagates the `OutputBin` attribute from the printer job attributes to `NSPrintInfo` print settings with `OutputBin` key on macOS.
>>
>> The fix was tested on `Kyocera ECOSYS M8130cidn` printer where `ppdFindOption(..., "OutputBin")` call returns 4 output bins (text, choice):
>> - Printer settings, None
>> - Inner tray, INNERTRAY
>> - Separator tray, SEPARATORTRAY
>> - Finisher (face-down), Main
>>
>> if `Printer settings`, `Inner tray`, or `Finisher (face-down)` CustomOutputBins is set to `PrinterJob.print(...)` attributes a test page is printed to the Main tray of the `Kyocera ECOSYS M8130cidn` printer. If `Separator tray` is used a page is printed to the Separator tray. This is consistent with the printer behavior when a native print dialog is used from a native Preview app to print a document on macOS.
>
> Alexander Scherbatiy has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove System.out.printf(...)
src/java.desktop/share/classes/javax/print/attribute/standard/OutputBin.java line 47:
> 45: * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is
> 46: * the IPP attribute name. The {@code toString()} method returns the IPP
> 47: * string representation of the attribute value.
I think this needs to mention that it is an IPP extension attribute, meaning not a standard one
For example like here
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/print/attribute/standard/PresentationDirection.html
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16166#discussion_r1362764128
More information about the client-libs-dev
mailing list