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
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