[OpenJDK 2D-Dev] RFR 6870661 : Setting a custom PrintService on a PrinterJob leads to a PrinterException

Phil Race philip.race at oracle.com
Mon Jun 17 19:45:56 UTC 2013


Patrick,

The spec. for PrinterJob.setPrintService() says :-

*Throws:*
    |PrinterException
    <http://docs.oracle.com/javase/6/docs/api/java/awt/print/PrinterException.html>|
    - if the specified service does not support 2D printing,
      or this PrinterJob class does not support setting a 2D print service,
    or the specified service is otherwise not a valid print service.

So an exception is expected.

If I understand your fix you want to change it so that WPrinterJob simply
doesn't go down to native so is less specific about what Service it will
accept? But WPrinterJob is completely tied to Win32PrintService
and windows native printing. The Windows print dialog for example
will  know nothing about your service.

So this seems like not a bug. You should just use javax.print APIs in 
this case.

-phil.



On 6/15/2013 8:19 AM, Patrick Reinhart wrote:
> Could someone review my fix?
>
> http://reinharts.dyndns.org/6870661/webrev.00
>
> Cheers
>
> Patrick
>
>
> On 06/11/2013 10:32 PM, Patrick Reinhart wrote:
>> Hi Phil,
>>
>> I just started looking into this Bug and have already written a test 
>> to prove a later fix though. As it seems that there missing two 
>> checks make sure, that the actual PrintService is a instance of 
>> W32PrintService  before passing it to the native method 
>> setNativePrintService()
>>
>> Fix proposal for this bug is as follows:
>>
>> http://reinharts.dyndns.org/6870661/webrev.00
>>
>> Can you take a look into it and give me some feedback on it. 
>> Unfortunally I did not get the Jtreg test running under Windows 
>> (executing it as plain Java application at least does work)
>>
>> Cheers
>>
>> Patrick
>>
>




More information about the 2d-dev mailing list