1036 // but CUPS can get the media from PPD, so we still report as
1037 // supported category.
1038 if (isCupsPrinter) {
1039 if (!catList.contains(Media.class)) {
1040 catList.add(Media.class);
1041 }
1042
1043 // Always add MediaPrintable for cups,
1044 // because we can get it from PPD.
1045 catList.add(MediaPrintableArea.class);
1046
1047 // this is already supported in UnixPrintJob
1048 catList.add(Destination.class);
1049
1050 // It is unfortunate that CUPS doesn't provide a way to query
1051 // if printer supports collation but since most printers
1052 // now supports collation and that most OS has a way
1053 // of setting it, it is a safe assumption to just always
1054 // include SheetCollate as supported attribute.
1055
1056 /*
1057 In Linux, we use Postscript for rendering but Linux still
1058 has issues in propagating Postscript-embedded setpagedevice
1059 setting like collation. Therefore, we temporarily exclude
1060 Linux.
1061 */
1062 if (!PrintServiceLookupProvider.isLinux()) {
1063 catList.add(SheetCollate.class);
1064 }
1065 }
1066
1067 // With the assumption that Chromaticity is equivalent to
1068 // ColorSupported.
1069 if (getAttMap != null && getAttMap.containsKey("color-supported")) {
1070 catList.add(Chromaticity.class);
1071 }
1072
1073 // CUPS does not report printer resolution via IPP but it
1074 // may be gleaned from the PPD.
1075 PrinterResolution[] supportedRes = getPrintResolutions();
1076 if (supportedRes != null && (supportedRes.length > 0)) {
1077 catList.add(PrinterResolution.class);
1078 }
1079
1080 supportedCats = new Class<?>[catList.size()];
1081 catList.toArray(supportedCats);
1082 Class<?>[] copyCats = new Class<?>[supportedCats.length];
1083 System.arraycopy(supportedCats, 0, copyCats, 0, copyCats.length);
1084 return copyCats;
|
1036 // but CUPS can get the media from PPD, so we still report as
1037 // supported category.
1038 if (isCupsPrinter) {
1039 if (!catList.contains(Media.class)) {
1040 catList.add(Media.class);
1041 }
1042
1043 // Always add MediaPrintable for cups,
1044 // because we can get it from PPD.
1045 catList.add(MediaPrintableArea.class);
1046
1047 // this is already supported in UnixPrintJob
1048 catList.add(Destination.class);
1049
1050 // It is unfortunate that CUPS doesn't provide a way to query
1051 // if printer supports collation but since most printers
1052 // now supports collation and that most OS has a way
1053 // of setting it, it is a safe assumption to just always
1054 // include SheetCollate as supported attribute.
1055
1056 catList.add(SheetCollate.class);
1057
1058 }
1059
1060 // With the assumption that Chromaticity is equivalent to
1061 // ColorSupported.
1062 if (getAttMap != null && getAttMap.containsKey("color-supported")) {
1063 catList.add(Chromaticity.class);
1064 }
1065
1066 // CUPS does not report printer resolution via IPP but it
1067 // may be gleaned from the PPD.
1068 PrinterResolution[] supportedRes = getPrintResolutions();
1069 if (supportedRes != null && (supportedRes.length > 0)) {
1070 catList.add(PrinterResolution.class);
1071 }
1072
1073 supportedCats = new Class<?>[catList.size()];
1074 catList.toArray(supportedCats);
1075 Class<?>[] copyCats = new Class<?>[supportedCats.length];
1076 System.arraycopy(supportedCats, 0, copyCats, 0, copyCats.length);
1077 return copyCats;
|