[OpenJDK 2D-Dev]  RFR JDK-8211055:Provide print to a file (PDF) feature even when printer was not connected
philip.race at oracle.com
Wed Oct 3 00:01:12 UTC 2018
Good enough to fix the regression.
On 9/26/18, 11:24 PM, Prasanta Sadhukhan wrote:
> I have added @requires tag and also did an initial check of existing
> printers and exit if there is any.
> Regarding setting,retrieving Destination attribute, if we do not show
> the print dialog and ask user to select file and ok,
> it will not set call nsPrintInfoToJavaPrinterJob which is called from
> showDialog() and so NSPrintJobDispositionValuewill not be set up and
> setPrintToFile() will not be called.
> I checked in jdk8GA too, it fails if we set Destination and try to
> print. I guess existing customer issue is about not printing if user
> manually selects "Save as PDF". I guess I can work on that issue as a
> separate bug.
> Modified test
> On 26-Sep-18 9:48 PM, Phil Race wrote:
>> This is all MacOS specific changes - and functionality - but the test
>> to be cross-platform. Shouldn't it at least have an @requires macos tag ?
>> And I think the test should verify there are no printers and say it can't
>> be run if you have any ... and exit ...
>> Can we set & retrieve the file as a Destination attribute ?
>> Then we can verify the file was saved without the user's help
>> 123 " 4. Another dialog opends prompting for filename, enter any filename and press \"Save\".\r\n" +
>> opends -> opens
>> On 09/26/2018 04:38 AM, Prasanta Sadhukhan wrote:
>>> Hi All,
>>> Please review a fix for an issue where it is seen that if we do not
>>> have any printer installed and we try to save the printjob to a file
>>> via "Save as PDF" option in mac, it was throwing PrinterExcetion:no
>>> printer service found.
>>> This is a regression of JDK-8132988 where a check was added to make
>>> sure PrinterException is thrown if there is no printer installed.
>>> Proposed fix is to find out if user is selecting "Save as PDF"
>>> option in native print dialog which will cause NSPrintInfo's
>>> jobDisposition value to be |NSPrintSaveJob
>>> |In that case, the previous "no-printer" check is amended to also
>>> check if the print operation is saving to a file, in which case do
>>> not throw PrinterException and proceed with Save-File operation.
>>> JDK-8132988 testcase also works ok after this fix.
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8211055
>>> webrev: http://cr.openjdk.java.net/~psadhukhan/8211055/webrev.0/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the 2d-dev