File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Linux + Java Printing Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Reply Bookmark "Linux + Java Printing" Watch "Linux + Java Printing" New topic
Author

Linux + Java Printing

Christopher Arthur
Ranch Hand

Joined: Mar 09, 2004
Posts: 148
Hi,

I'm writing an application that uses java printing (java.awt.print.) and I'm getting quirky behavior. When I call PrinterJob.print, I can see that my job is sent to the printer since the printer icon appears on my desktop, but the printer doesn't start printing until I turn off the computer and restart it. By the way, I'm running Fedora Core 5 with Turboprint, but other applications print just fine.

Chris
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12510

You might be having problems with the cups daemon. Some things to check are use of the "lpq" command and pointing your web browser to http://localhost:631 , which is where the cups manager lives.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
karthik Suryanarayanan
Ranch Hand

Joined: Oct 07, 2009
Posts: 88

Is that mandatory to use CUPS .. I mean i am printing my datas using java in Unix server. But i find my printer printing only Junk characters . I used the lpr command and printed a document. It works fine but when i call the printer API through my Java code and run it , it does not work neither it shows any exception. i can find my datas are stored temporarily in a location with .ps extension . I am using EPSON LQ-690 printer . Also found out that DataType of the file is shown as RAW whereas when i use lpr to print , it shows as TEXT . So how could i get my datas printed. I went through CUPS and GhostScript sites but i need to know what's the reason for this and how i could overcome this issue.


"Learning is a Culture where your Eagerness & Curiosity plays a major Role".
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12510

Karthik, Please don't wake the zombies! Even if it is Hallow'een. We don't charge extra for starting your own thread.

Unix/Linux doesn't need to use a print daemon, however, since they are both designed as multi-user systems, use of a central spooler helps keep everything tidy and manageable.

Conventionally, printing in *n*x is done as either plain text or PostScript and sent to the printing subsystem (cups or lpd). The output is spooled, then, when an eligible printer becomes free, the printer driver will translate the portable format data in the spool into whatever sequences are required to print on the printer, based on how that printer was defined to the printing subsystem.

You can also output printer data in brute-force format such as PCL4, although this is something you'd normally only want to do if you need to exploit a particular hardware feature.

Possible trouble spots are cases where the translation occurs either too many times or not enough times. A bug in CUPS releases a couple of years ago wrecked my printing for the entire month of August because my desktop was rendering output in Postscript, forwarding it to the main CUPS server, which rendered the PostScript in PostScript, and the resulting output was a PostScript program listing instead of the desired results.
 
 
subject: Linux + Java Printing
 
Threads others viewed
Output data to printer
Which forum to use for java printing questions
How to reverse Pages using java Printing?
Printing with POS Printer
Let's play, find a printer
developer file tools