This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Printing in Java using printDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Printing in Java using printDialog" Watch "Printing in Java using printDialog" New topic

Printing in Java using printDialog

Henrik Engert
Ranch Hand

Joined: Apr 26, 2005
Posts: 70

We have an application where the user uses a receipt printer which has rolls of paper. They also have regular printers attached to the PC. The standard printer is NOT the receipt printer.

If the above scenario is true and the user selects to print a receipt with the receipt printer the standard paper that is chosen is A4 and not the standard rollsize of 80 x 297 mm from the receipt printer. Therefore the printing is all messed up, stuff ends up outside the paper. BUT if the user sets it's receipt printer as the standard printer everything works fine, it choses 80 x 297 mm.

When the printDialog appears the user can select 80 x 297 mm and then it works, or else A4 is preselected (if the regular printer is standard for example inkjet or laser).

This is the code we use:

Any clues why it behaves like this?

[ February 08, 2007: Message edited by: Henrik Engert ]
[ February 09, 2007: Message edited by: Henrik Engert ]

It is sorta covered in the JavaRanch Style Guide.
subject: Printing in Java using printDialog
Similar Threads
need simple programe in swing, in which component will not stretch with win size
PrintDialog for selecting the printers
boxing,==, and equals()
Printer margin question
jsp:useBean and jsp:setProperty question