|Published (Last):||22 September 2012|
|PDF File Size:||20.42 Mb|
|ePub File Size:||6.40 Mb|
|Price:||Free* [*Free Regsitration Required]|
Java Examples for Doc
I am trying to create a simple program that sends a sompledoc to a printer to print. This is what my program looks like:.
The program runs, and starts looping through all of the installed printers on the computer. But when it gets to the printer Simplddoc am looking for, I then get the following error:.
Not really sure what I’m doing wrong here, as the printer that I am searching for does in fact show up. What I did was put the string into an input stream, and changed DocFlavor.
Java example source code file (SimpleDoc.java)
My only hiccup now is that nothing actually prints unless something else is sent to the printer. Leaving this here for now for reference. So, the first thing you should do is checking which flavors are supported by your printer.
To render it, change the actual code:. So it means that DocFlavor. But you encounter another problem as the data to print doesn’t match to declared type associated to DocFlavor.
How to send raw data to printer with Java Ask Question. This is what my program looks like: But when it gets to the printer I am looking for, I then get the following error: Exception in thread “main” sun.
Any idea what I’m doing wrong here? What simp,edoc I do to fix this code and make it print? This is what I have so far: If your printer ejects individual sheets instead of emitting an unbroken stream of green-bar fan-fold paper, this knowledge is probably not helpful I would find that downright charming. Chase Aug 4 ’17 at 0: Simplddoc exception messages are rather helpful and should help you to find a solution. To render it, change the actual code: InputStream And the problem is there: You can for example provide an InputStream in this way: Here is the flavor constant to use: Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.