• Post Reply Bookmark Topic Watch Topic
  • New Topic

No instance of PrintService is being created

 
as chhipa
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Follwing is my program for printing the contents on Epson LX-300 Dot-Matrix Printer


-------------------------------------
I'm getting follwing exception

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at FilePrinterMain.main(FilePrinterMain.java:29)


at the line

System.out.println("len="+services[0].getName());
-----------------------------------------------
Operating System -------Windows 2000 Server
Printers

HP LaserJet 4000 Series PCL (Network Printer but currently unplaugged but mapped on my system)

Epson LX-300 (Local Printer which I'm currently using)

Print API:- Print API embeded with NetBeans IDE 5.0

[ Edited to include code tags - Paul Sturrock ]
[ November 17, 2006: Message edited by: Paul Sturrock ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Other API, where the Java Print Service API gets discussed more often.
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't worked much with the print api, but I believe this line:

will tell PrintService to use only PostScript printers and your local printer probably does not support PostScript.
I've had success using

which lets the printer, rather than the print API, determine how best to print a document and should allow PrintService to find your local printer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!