Problem in Printing a text file

Hi all good morning.

I have a problem. I am dynamically creating a text file depending on some creteria and I want to print that text file using java print API. I written the following code.

PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();

DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;

PrintService printService[] = PrintServiceLookup

.lookupPrintServices(flavor, pras);

PrintService defaultService = PrintServiceLookup

.lookupDefaultPrintService();

PrintService service = ServiceUI.printDialog(null, 200, 200,

printService, defaultService, flavor, pras);

if (service != null) {

DocPrintJob job = service.createPrintJob();

FileInputStream fis = new FileInputStream (file.getCanonicalPath());

DocAttributeSet das = new HashDocAttributeSet();

Doc doc = new SimpleDoc(fis, flavor, das);

job.print(doc, pras);

Thread.sleep(10000);

}

It worked fine for HP Printers. But it is not working with xerox printers.

If anybody knows solution please let me know

[1096 byte] By [snhpfb@ocimuma] at [2007-10-1 21:59:26]
# 1
Hi,I have the same problem with a Samsung Laser Printer.Anyone help me?Thanks
skaskaskaa at 2007-7-13 8:03:32 > top of Java-index,Other Topics,Java Community Process (JCP) Program...