}catch(IOException e){
throw new PrintException("cannotExport", e);
}
break;
case PRINTER_FILE_MODE:
StreamPrintService psPrinter = null;
String psMimeType = "application/postscript";
StreamPrintServiceFactory[] factories =
PrinterJob.lookupStreamPrintServices(psMimeType);
if (factories.length<1) {
throw new PrintException("noPSService", null);
}
FileOutputStream fos = null;
try {
// Get a full path for destination file
dest = new File(dest).getCanonicalPath();
fos = new FileOutputStream(dest);
psPrinter = factories[0].getPrintService(fos);
} catch (Exception e) {
throw new PrintException("cannotPrintToFile", e);
}
printPrinter(psPrinter, comp);
psPrinter.dispose();
try {
fos.close();
} catch (Exception e2) {
throw new PrintException("cannotPrintToFile", e2);
}