Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying barcode

 
Vijay Venkat
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
http://www.oreilly.com/catalog/java2d/chapter/ch04.html
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.
Sean
 
Vijay Venkat
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic