wood burning stoves
The moose likes Java in General and the fly likes Displaying barcode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Displaying barcode" Watch "Displaying barcode" New topic

Displaying barcode

Vijay Venkat
Ranch Hand

Joined: Aug 12, 2001
Posts: 52
I have the algorithm for the barcode.
But i dont now how to exactly paint it in panel and then print it.
Say how to draw a rectangle that is exactly one mm in width.
This i have to print exactly how is it possible. Please give me leads if not the exact answer.
I need to know about it. Its very urgent.
Thanks in advance
Sean MacLean
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
Perhaps the Java2D package would make this a bit easier since you can draw lines of various widths. Here's an O'Reilly sample chapter talking about it.
For printing, perhaps creating an Image object, then using it's graphics object to draw on might be best. This way you can save the image to disk or print it out (which may provide better resolution). Hope this helps.
Vijay Venkat
Ranch Hand

Joined: Aug 12, 2001
Posts: 52
Thankyou very much Sean MacLean- Thanks for the lead too.
But the real crux is !!!
My question is to how to print a rectangle or image that is exatly as per the reqquired size.
Now i am able to draw the image.
But for printing i need precision.
I have to draw a rectangle of specified size. Say height 135mm and width=1mm (max tolerance +- 0.024mm)
How do i map it to the printer.
Hope my question is clear.
I want to generated barcodes on labels or paper.
For that case their width and height has to be as per the standards.
How can i do it.
Help needed very badly.
Thanks to everyone.
Have great day
I agree. Here's the link: http://aspose.com/file-tools
subject: Displaying barcode
It's not a secret anymore!