print - lookupPrintServices working with OrientationRequested,NumberUp?

P

Pascal

Hi,
In my company, there are many printers able to print in "2 pages per
sheet"/landscape mode,
but

1°) when requested with the code below, no print service is found

DocFlavor postscriptFlavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
PrintRequestAttributeSet printRequestSet = new
HashPrintRequestAttributeSet();
printRequestSet.add(MediaSizeName.ISO_A4);
printRequestSet.add(new NumberUp(2));
printRequestSet.add(OrientationRequested.LANDSCAPE);

PrintService[] pservices =
PrintServiceLookup.lookupPrintServices(postscriptFlavor, null);

=> pservices = []

2°) print services are found if I remove the {NumberUp(2) and
OrientationRequested.LANDSCAPE} attributes in the
PrintRequestAttributeSet, but the document is printed with one page
per sheet
In this case,
the function
pservices.getSupportedAttributeValues(OrientationRequested.class, ...)
returns several values, among them OrientationRequested.LANDSCAPE

It means that the lookupPrintServices method cannot find a printer
supporting OrientationRequested.LANDSCAPE, but the lookupPrintServices
method can find a printer (without OrientationRequested attribute in
the request), and this printer supports
OrientationRequested.LANDSCAPE.

So I wonder if there are bugs in the lookupPrintServices method.

Anybody has an idea?
Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top