java命名空间java.awt.print类printerjob的类成员方法:
lookupstreamprintservices定义及介绍
本文导语:
lookupstreamprintservices
public static streamprintservicefactory[] lookupstreamprintservices(string mimetype)
定位可以成像 2d 图形的流打印服务工厂的便捷方法。示例用法:
fileoutputstream outstream;
streamprintservice psprinter;
string psmimetype = "application/pos...
lookupstreamprintservices
public static streamprintservicefactory[] lookupstreamprintservices(string mimetype)
- 定位可以成像 2d 图形的流打印服务工厂的便捷方法。示例用法:
fileoutputstream outstream;
streamprintservice psprinter;
string psmimetype = "application/postscript";
streamprintservicefactory[] factories =
printerjob.lookupstreamprintservices(psmimetype);
if (factories.length > 0) {
try {
outstream = new file("out.ps");
psprinter = factories[0].getprintservice(fos);
// psprinter can now be set as the service on a printerjob
} catch (filenotfoundexception e) {
}
}
在支持打印服务的 printerjob
实例上可以安装从此方法返回的服务。调用此方法等效于调用 streamprintservicefactory.lookupstreamprintservicefactories()
并指定一个 pageable docflavor。
- 参数:
mimetype
- 需要的输出格式;或 null,指任何格式。
- 返回:
- 2d 流打印服务工厂的数组,可能为空。
- 从以下版本开始:
- 1.4