"Already printed. Need to create new DocPrintJob.");
}
busyFlag = true;
}
DocFlavor userDocDF = userDoc.getDocFlavor();
/*
* Checking if doc.DocFlavor is supported by the current
* PrintService
*/
if (!printService.isDocFlavorSupported(userDocDF)) {
throw new PrintException("Doc flavor \'" + userDocDF
+ "\' is not supported");
}
/*
* Checking if doc.DocFlavor is supported directly by osClent. If it
* is not: - get StereamPrintServiceFactory for doc.DocFlavor -
* instantiate StreamPrintService - get PrintJob from it - run this
* PrintJob in separate thread
*/
printClient = printService.getPrintClient();
if (printService.isDocFlavorSupportedByClient(userDocDF)) {
printClient.print(userDoc, printRequestAS);
} else {
try {
Doc clientDoc = userDoc;
PipedOutputStream spsOutStream = new PipedOutputStream();
PipedInputStream clientInputStream = new PipedInputStream(
spsOutStream);
DocFlavor newFlavor = null;
StreamPrintServiceFactory spsf = null;
DocFlavor clientFlavors[] = printClient
.getSupportedDocFlavors();
for (int i = 0; i < clientFlavors.length; i++) {
StreamPrintServiceFactory[] factories = StreamPrintServiceFactory
.lookupStreamPrintServiceFactories(userDocDF,