acpuma
acpuma

Reputation: 519

java usb dot matrix printing

i am trying to print on the USB port with EPSON LX 350 dot matrix print. i am using windows 8.1 and printer can print test page in printer properties.

When i try to print some string, it runs without any problem. I see printer name as output. And i see 'java printing' line for 1 second in the printer status dialog of windows control panel. Then it disappear like it is finished printing. But it doesnt print and there is no activity in the printer. Here is the code i use for printing :

String defaultPrinter = PrintServiceLookup.lookupDefaultPrintService().getName();
System.out.println("Default printer: " + defaultPrinter);
PrintService service = PrintServiceLookup.lookupDefaultPrintService();

InputStream is = new ByteArrayInputStream("hello world!\f".getBytes("UTF8"));

DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
Doc doc = new SimpleDoc(is, flavor, null);
DocPrintJob job = service.createPrintJob();

job.print(doc, null);
is.close();

Is the problem about computer or java code or printer?

Upvotes: 0

Views: 2131

Answers (2)

Helen Cassia
Helen Cassia

Reputation: 11

I've had the same problem, i could solve it after install two driver/software:

  • Printer Driver v1.00
  • Status Monitor v4.02

You can get it here.

Upvotes: 0

acpuma
acpuma

Reputation: 519

After i plugin printer, windows 8 automatically installed driver for Epson LX-350. And i was using this driver. After i downloaded printer driver from website, printer worked as expected

Upvotes: 1

Related Questions