You almost had it. For some reason you aren't properly using the answer ("Object [] res") you got from the service, so you are only seeing the first of the list. And I'm not sure where you got MediaRequested from, that
should not compile as there's no such class.

That should be
Media[] res = (Media[])getSupportedAttributeValues(Media.class, null, null);

Then print each of the elements of "res".

-phil.

ssinai wrote:
Given a print service from something like

PrintService defaultPrintService =
PrintServiceLookup.lookupDefaultPrintService()

is there a way to query the default print service to get the paper sizes
that print service (printer) can handle?  For example, I'd like to get a
list back containing things like "Legal", "Letter", "A4", "A5", "B4", etc.

I'm fiddling around with the following code...

PrintService defaultPrintService =
PrintServiceLookup.lookupDefaultPrintService();
Object [] res = (Object
[])defaultPrintService.getSupportedAttributeValues(Media.class, null, null);
MediaRequested mr = (MediaRequested)res[0];
System.out.println("mr="+mr);

and the final result is "mr=na-letter".

I was hoping I'd get a list of legal paper sizes.   Is this even possible?

Thanks.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to