• Post Reply Bookmark Topic Watch Topic
  • New Topic

I cant print, and docs in print queue all have 2048 bytes  RSS feed

 
Jorge Pinho
Greenhorn
Posts: 25
MySQL Database PHP Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all,

I am going crazy on this one...

I am not sure if this is a Java problem or a SO problem, anyway...

I have a small tomcat webapp that prints some docs on a local printer.

I can print from any other app (openOffice, gEdit, Firefox, etc...), except this one.

The docs are on print queue for a while and then they disapear...
their file size is always 2048 bytes
Absolutly no error is reported

Does anyone have any clue why is this happening ?

Is there a way to view the contents of a doc on the print queue ?

I have already printed sucessfuly from Java on that machine, from java apps and webapps.

(Linux Fedora Core 2, Java 1.4.2 and Tomcat 5.0)... I know, its old !!!

I tested on WinXP and all is OK.

Thankx,
Jorge Pinho
 
Ninad Kulkarni
Ranch Hand
Posts: 802
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jorge,
Would you provide sample code?
 
Jorge Pinho
Greenhorn
Posts: 25
MySQL Database PHP Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ninad, thanks for your reply...

The problem is that I dont know exactly what to post... the lines to print are everywhere on the business layer for 5 business docs, this is code:

PrinterJob pj = PrinterJob.getPrinterJob();

... lots and lots of business logic ...

job.setPrintable(invoicePainter);

try {
job.setJobName("invoice");
job.print();
} catch(....) {
loggging....
}

This piece of code is everywhere and the docs do go to the print queue... however I dont know what happens so that the docs only have 2048 bytes of size (only on the linux).

The webapp (struts 1.2.8) just calls a business class to print...

I really dont know what else to say

 
Peter Taucher
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And I guess you're pretty sure your Printable implementation does actually print something? Did you insert logging / debug information there?
 
Jorge Pinho
Greenhorn
Posts: 25
MySQL Database PHP Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Peter,

Yes, everything prints fine on WinXP...

Since the docs are in the print queue, shouldnt at least print a blank page ?

I am going to debug on production, to see if I spot something...

Hope someone has any idea...

Thank You
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!