This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing to Wireless printer.

 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using javax.print package to print a text document. I can get the default printer (I can print the name of the printer). But when I create the DocPrintJob object and call it's .print() function,
nothing happens .

The only difference between this printer and the one I test on at the office is that the one at the office is a network printer (non-wireless) and the one at my house is wireless.
Is there something different I have to do to get it to print to a wireless printer? No exception is throw so I don't know how to debug it to see what the problem is.

Thanks,

Justin
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added a PrintJobListener to the job, only the 'DataTransferCompleted' and 'NoMoreEvents' events are raised.

Justin
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is my code:


Justin
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And the PrintJobListener class code:

 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm starting to think Java's ability to print to HP printers is limited if not non-existent.

I have a wireless laserjet at home that won't print and I have a LasterJet 1000 series at work that won't print as well.

No more HP printers for me!

Justin
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok... I got the bright idea maybe I should look at the print queue to see if it's even getting that far, and it is.
I looked at the document properties and it says 0 bytes. I tried some different flavors, but none work besides AUTOSENSE.

The print job starts and then just deletes itself, but I'm sure that's because it's 0 bytes...

anyone know a way to deal with this problem?

Justin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic