I have a problem with a print service in Java. I need to print a simple text document on my default printer. I use HP Deskjet as my printer on a Windows computer and all drivers are installed. This is the source code I'm using:
import java.io.*; import javax.print.*; public class PrintTest { public static void main(String[] args) throws IOException { File file = new File("print.txt"); InputStream is = new BufferedInputStream(new FileInputStream(file));
I see a print job in the printer queue a few milliseconds before it disappears. But nothing is printed. I heard about this because the Java print service in JDK 1.6 is still not working. But I'm not quite sure. Any ideas why?
source share