Hi,

----- original Nachricht --------

Betreff: tray printing not working
Gesendet: Mo, 03. Mai 2010
Von: Oguz Yarimtepe<[email protected]>

> I am using JAVA print API and PDFBox to print a PDF file from the tray
> of the printer. The printer is Xerox Phaser 3428. Below is the code
> part i am using to choose the tray and send print. My application is
> an applet.. Changing attrSet.add(MediaTray.BOTTOM); to TOP or MANUAL
> didn't effect the te way that printer select the tray. It always got
> the paper from TOP tray. Any idea what the reason is?
I suggest to determine if your printer even supports to select the tray. 

To get the supported categories, try something like this:

PrintService printservice = PrintServiceLookup.lookupDefaultPrintService();
Class[] categories = printservice.getSupportedAttributeCategories();
for (int i=0;i<categories.length;i++)
        
System.out.println(categories[i].getName()+"="+lPrintservice.getDefaultAttributeValue(categories[i]));

To check if a particular attribute value is supported try something like this:

PrintService printservice = PrintServiceLookup.lookupDefaultPrintService();
HashPrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet(); 
attributes.add(MediaTray.TOP);
System.out.println(printservice.isAttributeValueSupported(MediaTray.BOTTOM, 
DocFlavor.SERVICE_FORMATTED.PAGEABLE, attributes));

HTH
Andreas Lehmkühler

Reply via email to