File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Linux + Java Printing

 
Christopher Arthur
Ranch Hand
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17641
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
karthik Suryanarayanan
Ranch Hand
Posts: 121
Java Opera Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17641
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic